Bablu Raul created HDDS-17308:
---------------------------------

             Summary: ListObjectsV2 Incorrectly Filters CommonPrefixes When 
StartAfter Is Before the Matching Prefixes
                 Key: HDDS-17308
                 URL: https://issues.apache.org/jira/browse/HDDS-17308
             Project: Apache Ozone
          Issue Type: Bug
          Components: S3
            Reporter: Bablu Raul


When the S3 {{ListObjectsV2}} API is called with the {{{}Prefix{}}}, 
{{{}Delimiter{}}}, and {{StartAfter}} parameters, the Ozone S3 Gateway 
incorrectly excludes matching common prefixes that sort lexicographically after 
the specified {{StartAfter}} value.

For example, the bucket contains the following object keys:
 * {{dir1bh/file1}}

 * {{dir1bha/file1}}

A request with {{Prefix=dir1bh}} and {{Delimiter=/}} correctly returns the 
common prefixes {{dir1bh/}} and {{{}dir1bha/{}}}.

However, when the same request includes {{{}StartAfter=dir1/dir2/file1{}}}, 
neither common prefix is returned, even though both sort lexicographically 
after the specified value.


h2. Steps to Reproduce
 # Configure and start the Ozone S3 Gateway.

 # Ensure that the bucket contains the following objects:

 ** {{dir1bh/file1}}

 ** {{dir1bha/file1}}

 # Execute {{ListObjectsV2}} with the prefix:

{{aws s3api list-objects-v2 \
  --bucket "$BUCKET" \
  --prefix dir1bh}}

Both matching object keys are returned.
 # Execute {{ListObjectsV2}} with the prefix and delimiter:

{{aws s3api list-objects-v2 \
  --bucket "$BUCKET" \
  --prefix dir1bh \
  --delimiter /}}

The response contains both common prefixes:

{{{
  "CommonPrefixes": [
    \{"Prefix": "dir1bh/"},
    \{"Prefix": "dir1bha/"}
  ],
  "Prefix": "dir1bh"
}}}
 # Add the {{StartAfter}} parameter:

{{aws s3api list-objects-v2 \
  --bucket "$BUCKET" \
  --prefix dir1bh \
  --delimiter / \
  --start-after 'dir1/dir2/file1'}}
h2. Actual Result

The response does not contain the {{CommonPrefixes}} field, and neither 
{{dir1bh/}} nor {{dir1bha/}} is returned.
h2. Expected Result

The response should include both {{dir1bh/}} and {{{}dir1bha/{}}}, because both 
common prefixes sort lexicographically after the specified {{StartAfter}} value.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to