Skip to content

HDDS-16709. Remove redundant ListStatusLight RPC from S3 root listings in FSO buckets - #11408

Open
rich7420 wants to merge 3 commits into
apache:masterfrom
rich7420:HDDS-16709
Open

rich7420 wants to merge 3 commits into
apache:masterfrom
rich7420:HDDS-16709

Conversation

@rich7420

@rich7420 rich7420 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

For FSO buckets, S3 ListObjects and ListObjectsV2 with delimiter=/, an empty prefix, and no marker, start-after or continuation token first query ListStatusLight to find the starting key, then query it again to list the root entries.

Start the first shallow-listing batch directly from the bucket root, preserving the first entry, ordering, pagination and permission checks. Empty buckets and requests with non-empty prefixes or markers retain their existing behavior.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16709

How was this patch tested?

A temporary S3 HTTP/OpenTelemetry probe compared 211 matching requests before and after the change. Listing results, pagination and error responses matched. OM server spans matched their client RPC spans:

Request Before After
Eligible non-empty FSO root first page 2 ListStatusLight RPCs 1 ListStatusLight RPC
Empty buckets and prefix/marker controls Existing RPC counts Unchanged

26 eligible requests each saved one RPC; total OM RPCs were 1,033 → 1,007. Authorization controls used a non-secure mini-cluster with ACL checks and a custom authorizer enabled; this was not a Kerberos, Ranger or STS integration test. The temporary probe is not included in the patch. The separate 10×10 flaky-test check has not been run.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the client label Oct 5, 2026

@chungen0126 chungen0126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rich7420 for working on this.

Comment on lines +1897 to +1900
}

// Root listings above are ready; other initial listings still need a start key.
if (!addedKeyPrefix()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't seem to need a separate if (!addedKeyPrefix()) block here. This logic can be merged into the existing if (!addedKeyPrefix()) block above.

@echonesis echonesis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rich7420 for the patch.

Comment on lines +168 to +180
@ParameterizedTest
@ValueSource(strings = {"dir/", "/"})
void shallowListingWithPrefixKeepsSeed(String prefix) throws IOException {
ClientProtocol proxy = mock(ClientProtocol.class);
when(proxy.listStatusLight(any())).thenAnswer(invocation ->
new ArrayList<>(Arrays.asList(keyStatus(prefix + "file", false))));

fsoBucket(proxy).listKeys(prefix, null, true);

ArgumentCaptor<ListStatusLightOptions> options = ArgumentCaptor.forClass(ListStatusLightOptions.class);
verify(proxy, times(2)).listStatusLight(options.capture());
assertTrue(options.getAllValues().get(0).isAllowPartialPrefixes());
assertFalse(options.getAllValues().get(1).isAllowPartialPrefixes());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could we also add a case with an empty prefix and a non-empty prevKey? This would verify that marker-based listings still make both ListStatusLight calls and exclude the marker from the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants