rich7420 commented on code in PR #11964:
URL: https://github.com/apache/ozone/pull/11964#discussion_r4503403249


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java:
##########
@@ -2157,18 +2157,28 @@ private boolean getChildrenKeys(String keyPrefix, 
String startKey,
       // listStatus API expects a not null 'startKey' value
       startKey = startKey == null ? "" : startKey;
 
+      // listPrefix is required for HDDS-17413 (OM widens listing when keyName
+      // matches an existing dir that is the user listKeys prefix). It must 
only be
+      // set on the first page at that path (startKey blank): otherwise OM 
would
+      // apply the same widening on every pagination step and sibling listing 
under
+      // the same keyPrefix string, causing timeouts. Deeper DFS uses other 
keyPrefix
+      // values or non-empty startKey and omits listPrefix.
+      ListStatusLightOptions.Builder optionsBuilder = 
ListStatusLightOptions.builder()
+          .setVolumeName(volumeName)
+          .setBucketName(name)
+          .setKeyName(keyPrefix)
+          .setRecursive(false)
+          .setStartKey(startKey)
+          .setNumEntries(listCacheSize)
+          .setAllowPartialPrefixes(true);
+      if (StringUtils.isBlank(startKey)
+          && OmUtils.normalizeKey(keyPrefix, true)
+              .equals(OmUtils.normalizeKey(getKeyPrefix(), true))) {
+        optionsBuilder.setListPrefix(getKeyPrefix());

Review Comment:
   `listKeys("dir1bh", "", false)` repeatedly returns `dir1bh/`. DFS pushes the 
same directory with an empty start key, so this guard remains true and never 
enters its children.



-- 
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