Move all List calls to honor new maxObjectList limit (#8459)

master
Harshavardhana 5 years ago committed by kannappanr
parent 8cc5ecec23
commit 599aae5ba6
  1. 4
      cmd/bucket-handlers-listobjects.go
  2. 2
      cmd/config.go
  3. 2
      cmd/daily-lifecycle-ops.go
  4. 2
      cmd/iam-object-store.go
  5. 10
      cmd/web-handlers.go
  6. 2
      cmd/xl-sets.go

@ -128,7 +128,7 @@ func (api objectAPIHandlers) ListBucketObjectVersionsHandler(w http.ResponseWrit
// ListObjectsV2Handler - GET Bucket (List Objects) Version 2. // ListObjectsV2Handler - GET Bucket (List Objects) Version 2.
// -------------------------- // --------------------------
// This implementation of the GET operation returns some or all (up to 1000) // This implementation of the GET operation returns some or all (up to 10000)
// of the objects in a bucket. You can use the request parameters as selection // of the objects in a bucket. You can use the request parameters as selection
// criteria to return a subset of the objects in a bucket. // criteria to return a subset of the objects in a bucket.
// //
@ -210,7 +210,7 @@ func (api objectAPIHandlers) ListObjectsV2Handler(w http.ResponseWriter, r *http
// ListObjectsV1Handler - GET Bucket (List Objects) Version 1. // ListObjectsV1Handler - GET Bucket (List Objects) Version 1.
// -------------------------- // --------------------------
// This implementation of the GET operation returns some or all (up to 1000) // This implementation of the GET operation returns some or all (up to 10000)
// of the objects in a bucket. You can use the request parameters as selection // of the objects in a bucket. You can use the request parameters as selection
// criteria to return a subset of the objects in a bucket. // criteria to return a subset of the objects in a bucket.
// //

@ -49,7 +49,7 @@ func listServerConfigHistory(ctx context.Context, objAPI ObjectLayer) ([]madmin.
// List all kvs // List all kvs
marker := "" marker := ""
for { for {
res, err := objAPI.ListObjects(ctx, minioMetaBucket, minioConfigHistoryPrefix, marker, "", 1000) res, err := objAPI.ListObjects(ctx, minioMetaBucket, minioConfigHistoryPrefix, marker, "", maxObjectList)
if err != nil { if err != nil {
return nil, err return nil, err
} }

@ -135,7 +135,7 @@ func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
// List all objects and calculate lifecycle action based on object name & object modtime // List all objects and calculate lifecycle action based on object name & object modtime
marker := "" marker := ""
for { for {
res, err := objAPI.ListObjects(ctx, bucket.Name, commonPrefix, marker, "", 1000) res, err := objAPI.ListObjects(ctx, bucket.Name, commonPrefix, marker, "", maxObjectList)
if err != nil { if err != nil {
continue continue
} }

@ -568,7 +568,7 @@ func listIAMConfigItems(objectAPI ObjectLayer, pathPrefix string, dirs bool,
marker := "" marker := ""
for { for {
lo, err := objectAPI.ListObjects(context.Background(), lo, err := objectAPI.ListObjects(context.Background(),
minioMetaBucket, pathPrefix, marker, SlashSeparator, 1000) minioMetaBucket, pathPrefix, marker, SlashSeparator, maxObjectList)
if err != nil { if err != nil {
select { select {
case ch <- itemOrErr{Err: err}: case ch <- itemOrErr{Err: err}:

@ -418,7 +418,8 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
nextMarker := "" nextMarker := ""
// Fetch all the objects // Fetch all the objects
for { for {
result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000) result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator,
maxObjectList)
if err != nil { if err != nil {
return toJSONError(ctx, err, args.BucketName) return toJSONError(ctx, err, args.BucketName)
} }
@ -532,7 +533,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
nextMarker := "" nextMarker := ""
// Fetch all the objects // Fetch all the objects
for { for {
lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000) lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, maxObjectList)
if err != nil { if err != nil {
return &json2.Error{Message: err.Error()} return &json2.Error{Message: err.Error()}
} }
@ -711,7 +712,7 @@ next:
marker := "" marker := ""
for { for {
var lo ListObjectsInfo var lo ListObjectsInfo
lo, err = listObjects(ctx, args.BucketName, objectName, marker, "", 1000) lo, err = listObjects(ctx, args.BucketName, objectName, marker, "", maxObjectList)
if err != nil { if err != nil {
break next break next
} }
@ -1363,7 +1364,8 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) {
// date to the response writer. // date to the response writer.
marker := "" marker := ""
for { for {
lo, err := listObjects(ctx, args.BucketName, pathJoin(args.Prefix, object), marker, "", 1000) lo, err := listObjects(ctx, args.BucketName, pathJoin(args.Prefix, object), marker, "",
maxObjectList)
if err != nil { if err != nil {
return return
} }

@ -1620,7 +1620,7 @@ func (s *xlSets) HealObjects(ctx context.Context, bucket, prefix string, healObj
} }
} }
res, err := s.ListObjectsHeal(ctx, bucket, prefix, marker, "", 1000) res, err := s.ListObjectsHeal(ctx, bucket, prefix, marker, "", maxObjectList)
if err != nil { if err != nil {
continue continue
} }

Loading…
Cancel
Save