rich7420 opened a new pull request, #11397: URL: https://github.com/apache/ozone/pull/11397
## What changes were proposed in this pull request? Paginated ListBuckets and ListDirectoryBuckets can call `hasNext()` again after the bucket iterator is exhausted, causing another empty `ListBuckets` RPC. Check the page limit before advancing the iterator, and perform the lookahead only when the page is full. This avoids the repeated fetch on non-empty final pages while preserving continuation tokens and directory-bucket filtering. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16673 ## How was this patch tested? - `TestRootList`: 39 tests passed; the new RPC-count assertions fail without the production change. - [TestRootList 10×10](https://github.com/rich7420/ozone/actions/runs/36992226655) passed. - Real HTTP/OM RPC tracing on master `ae281be314`, before/after applying the patch: one fewer `ListBuckets` RPC on exact and short final pages for both APIs. Continuing pages and unpaginated listing kept the same counts. Response sizes, directory filtering, and token presence were checked; each scenario was repeated. - [Fork CI](https://github.com/rich7420/ozone/actions/runs/36992173530) failed in the existing client container-close assertion, outside the changed S3 Gateway path. That job is being rerun. Generated-by: Codex (GPT-6) -- 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]
