Gargi-jais11 commented on code in PR #12105:
URL: https://github.com/apache/ozone/pull/12105#discussion_r4639740085


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -570,6 +570,50 @@ public void testListKeysWithStartKeyBeforePrefix() throws 
Exception {
     assertEquals(Collections.emptyList(), listKeyNames(volumeName, bucketName, 
"dir1bi", "dir1bh", 100));
   }
 
+  /**

Review Comment:
   Extend both tests with at least one key that sorts after `/ `and should be 
included in the listing, e.g. /keep (and optionally a key that sorts before / 
but should not appear when the client uses Prefix=/, e.g. .cache/0).
   That proves OM seeks past .cache/* and does not restart from the first 
bucket key.



##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/AbstractS3SDKV2Tests.java:
##########
@@ -2156,6 +2157,25 @@ public void 
testListObjectsStartAfterBeforePrefix(BucketLayout layout) throws Ex
     assertThat(v2AfterPrefix.contents()).isEmpty();
   }
 
+  /**
+   * Prefix "/" matches no key here. On an OBS bucket, S3 Gateway still pages 
through the whole bucket and filters
+   * the keys, so pagination must end when a page ends at a key that sorts 
before "/".
+   */
+  @ParameterizedTest
+  @EnumSource(value = BucketLayout.class, names = {"OBJECT_STORE", 
"FILE_SYSTEM_OPTIMIZED"})
+  @Timeout(120)
+  public void testListObjectsSlashPrefix(BucketLayout layout) throws Exception 
{

Review Comment:
   put .cache/0 and /keep, then listObjectsV2 with prefix("/") and assert 
contents contains only /keep (and does not include .cache/0). That is the 
end-to-end case that used to hang and must still return data for matching keys.
   
   Without keys after /, we only test “empty result plus no infinite loop,” not 
“correct filtered listing after pagination fix.”



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to