Copilot commented on code in PR #10745:
URL: https://github.com/apache/ozone/pull/10745#discussion_r3607026993
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2993,8 +2993,13 @@ public List<OmBucketInfo> listBuckets(String volumeName,
String startKey,
volumeName, null, null);
}
metrics.incNumBucketLists();
- return bucketManager.listBuckets(volumeName,
+ List<OmBucketInfo> buckets = bucketManager.listBuckets(volumeName,
startKey, prefix, maxNumOfBuckets, hasSnapshot);
+ List<OmBucketInfo> enrichedBuckets = new ArrayList<>(buckets.size());
+ for (OmBucketInfo bucket : buckets) {
+ enrichedBuckets.add(enrichLinkBucketInfo(bucket));
+ }
+ return enrichedBuckets;
Review Comment:
`listBuckets` now enriches each entry by following bucket links. If link
resolution throws (eg ACL denial during link follow, detected link loop,
transient delete between list and resolve), the entire `listBuckets` call will
fail even though ACL checking for this API is currently only performed at the
volume level (ACLType.LIST). To preserve prior behavior and avoid a single
problematic link breaking the whole listing, handle link-enrichment failures
per bucket and fall back to returning the original bucket row when enrichment
fails.
--
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]