Skip to content

rgw: allow s3 bucket listing to return zero entries - #56312

Closed
cfsnyder wants to merge 4 commits into
ceph:mainfrom
cfsnyder:wip-cfsnyder-64185
Closed

cfsnyder wants to merge 4 commits into
ceph:mainfrom
cfsnyder:wip-cfsnyder-64185

Conversation

@cfsnyder

Copy link
Copy Markdown
Contributor

When a bucket index shard had many contiguous delete markers, a single bucket listing request could cause huge read amplification on the backend because RGW needed to iteratively loop through all of the delete markers in order to find at least one listable entry to sort among other shards and return a response to the client. In extreme cases, long latencies due to excessive iteration led to client timeouts and client retries, which compounded impact on cluster performance.

The AWS S3 specification does not make any promises about the number of entries that will be returned
and claims that continuation tokens are obfuscated and not real keys. This permits us to workaround the aforementioned problem by returning zero keys when excessive iteration is required, advancing the continuation token to a marker associated with an un-listable entry, and letting the client drive continued iteration with subsequent requests.

Fixes: https://tracker.ceph.com/issues/64185

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@cfsnyder
cfsnyder requested a review from a team as a code owner March 19, 2024 19:42
@cfsnyder
cfsnyder requested review from cbodley and ivancich March 19, 2024 19:43
@github-actions github-actions Bot added the rgw label Mar 19, 2024
cfsnyder added 4 commits April 8, 2024 20:57
When a bucket index shard had many contiguous delete markers,
a single bucket listing request could cause huge read
amplification on the backend because RGW needed to iteratively loop
through all of the delete markers in order to find at least one
listable entry to sort among other shards and return a response
to the client. In extreme cases, long latencies due to excessive
iteration led to client timeouts and client retries, which
compounded impact on cluster performance.

The AWS S3 specification does not make any promises
about the number of entries that will be returned
and claims that continuation tokens are obfuscated and not
real keys. This permits us to workaround the aforementioned
problem by returning zero keys when excessive iteration is
required, advancing the continuation token to a marker associated
with an un-listable entry, and letting the client drive continued
iteration with subsequent requests.

Fixes: https://tracker.ceph.com/issues/64185
Signed-off-by: Cory Snyder <[email protected]>
…progress with many non-current object versions

Signed-off-by: Cory Snyder <[email protected]>
This ensures that clients can make forwards progress when
listing a bucket that has many non-current object versions.

Signed-off-by: Cory Snyder <[email protected]>
…rough contiguous delete markers in versioned bucket

Signed-off-by: Cory Snyder <[email protected]>
@github-actions github-actions Bot added the tests label Apr 8, 2024
@cfsnyder
cfsnyder force-pushed the wip-cfsnyder-64185 branch from a706bdf to ef7d835 Compare April 8, 2024 20:58

@cbodley cbodley 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.

some initial comments. sorry for the delay. i'll need help from @ivancich to review the changes to the rados list-objects algorithm

adding this requires_nonempty_result flag essentially means we'd have to maintain two versions of the listing algorithm, one of which doesn't resolve the issue of timeouts

ultimately i prefer the approach that sends writespace characters to avoid request timeouts while rgw keeps working. you mentioned in slack that we could layer those changes on top of this work. maybe you could start by summarizing a design for that? for example, what would the Bucket::list() interface look like?

Comment thread src/rgw/rgw_rest_s3.cc Resolved
Comment on lines +153 to +155
if (r == RGWBIAdvanceAndRetryError) {
r = 0;
}

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.

it looks like this change would prevent us from ever entering the if (r == RGWBIAdvanceAndRetryError) { block below that tracks retry_objs

that's the intent, right? that we don't do retries at this level, but return back up to RGWRados::Bucket::List?

if so, can we clean up the rest of this stuff? are there any other changes from 5d28307 that should be reverted here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'll look at this again and do some more cleanup.

@cfsnyder

cfsnyder commented May 2, 2024

Copy link
Copy Markdown
Contributor Author

We discussed this in the RGW standup today. I'm going to update this PR so that the default behavior is to return whitespace and keep requests from timing out when advance and retry errors are causing excessive iteration. I'm also going to add a config parameter to allow the return of zero entries to be enabled as an alternative. cc. @ivancich

@cbodley

cbodley commented May 3, 2024

Copy link
Copy Markdown
Contributor

one difference between these two strategies is that the 'return zero entries' strategy has to take the minimum of all shard markers to return as NextContinuationToken. on the next request, all shards will restart listing from that position

when listing returns back to RGWListBucket for the whitespace strategy, it would be ideal if we preserved all of those shard markers so the next call can resume listing from those

we might consider introducing a sal::Bucket::ListOp interface (similar to Object::ReadOp/WriteOp/DeleteOp) so the derived RadosListOp can store all of the shard markers and any other state it needs for successive listings

@github-actions

github-actions Bot commented Jul 2, 2024

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jul 2, 2024
@cbodley cbodley removed the stale label Jul 2, 2024
@ivancich

Copy link
Copy Markdown
Member

ping @cfsnyder

@github-actions

github-actions Bot commented Sep 9, 2024

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@github-actions github-actions Bot removed the stale label Sep 26, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Nov 25, 2024
@cbodley cbodley removed the stale label Nov 25, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jan 24, 2025
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot removed the stale label Aug 13, 2025
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Oct 12, 2025
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants