Browse Source
Fix s3api_object_list_handlers returning contents less than the specified limit when more data actually exists (#4240 )
Fix when the stored data is actually enough but s3api_object_list_handlers returns less than the specified limit
Signed-off-by: changlin.shi <changlin.shi@ly.com>
pull/4242/head
LHHDZ
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
47 additions and
39 deletions
weed/s3api/s3api_objects_list_handlers.go
@ -146,8 +146,10 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
// check filer
err = s3a . WithFilerClient ( false , func ( client filer_pb . SeaweedFilerClient ) error {
for {
empty := true
nextMarker , doErr = s3a . doListFilerEntries ( client , reqDir , prefix , cursor , marker , delimiter , false , func ( dir string , entry * filer_pb . Entry ) {
empty = false
if entry . IsDirectory {
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
if delimiter == "/" { // A response can contain CommonPrefixes only if you specify a delimiter.
@ -192,12 +194,18 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
return doErr
}
if ! cursor . isTruncated {
nextMarker = ""
} else {
if cursor . isTruncated {
if requestDir != "" {
nextMarker = requestDir + "/" + nextMarker
}
break
} else if empty {
nextMarker = ""
break
} else {
// start next loop
marker = nextMarker
}
}
response = ListBucketResult {