Skip to content

rgw: add dedicated config for max aio during bucket index cleanup - #61760

Closed
clwluvw wants to merge 1 commit into
ceph:mainfrom
clwluvw:cleanindex-maxaio
Closed

clwluvw wants to merge 1 commit into
ceph:mainfrom
clwluvw:cleanindex-maxaio

Conversation

@clwluvw

@clwluvw clwluvw commented Feb 11, 2025

Copy link
Copy Markdown
Member

When a bucket with many shards is resharded, especially with large omaps, the deletion of old index shards can put significant load on the index pool. The default value of rgw_bucket_index_max_aio (128) results in deleting 128 shards simultaneously, which can exacerbate the issue. Introducing a dedicated config to control the maximum number of deletions allows for better management of this load during cleanup.

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

When a bucket with many shards is resharded, especially with large
omaps, the deletion of old index shards can put significant load on
the index pool. The default value of rgw_bucket_index_max_aio (128)
results in deleting 128 shards simultaneously, which can exacerbate
the issue. Introducing a dedicated config to control the maximum
number of deletions allows for better management of this load during
cleanup.

Fixes: https://tracker.ceph.com/issues/69910
Signed-off-by: Seena Fallah <[email protected]>
@clwluvw
clwluvw requested a review from a team as a code owner February 11, 2025 18:25
@clwluvw

clwluvw commented Feb 12, 2025

Copy link
Copy Markdown
Member Author

jenkins test windows

@cbodley

cbodley commented Feb 20, 2025 •

Copy link
Copy Markdown
Contributor

cc @markhpc @aclamk @rzarzynski @neha-ojha @mattbenjamin

when rgw deletes bucket index objects containing lots of omap keys, we rely on RocksDBStore::RocksDBTransactionImpl::rm_range_keys() to delete all of those keys at once. however, @neha-ojha's #33439 had disabled the use of rocksdb's DeleteRange primitive by raising rocksdb_delete_range_threshold to 1 million omap entries

as a result, RocksDBStore has to list all of the omap keys and delete each separately. Seena reports:

doing the iteration and delete one by one requires performing a range scan which is what I see on the OSDs (I saw ~600MB/s read and write at the same time on a single OSD)

#33439 cites "cpu and latency issues when DeleteRange is invoked for all objects" as the reason to disable it, and i assume that's related to the "range tombstones" created by DeleteRange that are visible to omap listings

i'm hoping that @cfsnyder's #45904 improved matters here:

Limits RocksDB omap Seek operations to the relevant key range of the object's omap. This prevents RocksDB from unnecessarily iterating over delete range tombstones in irrelevant omap CF shards. Avoids extreme performance degradation commonly caused by tombstones generated from RGW bucket resharding cleanup

i would really like to see rocksdb_delete_range_threshold restored to a reasonable value. what kind of testing is needed to verify that the issues leading to #33439 are resolved?

edit: i've opened https://tracker.ceph.com/issues/70108 against the rados project to track this

@rzarzynski

rzarzynski commented Feb 21, 2025 •

Copy link
Copy Markdown
Contributor

We will need to reconsider but taking into account also #46095.

BTW: I wonder whether there is a way a client (or just a cls) can hint a compaction to happen. I doubt we have any interface for that in place but the idea seems interesting.

@clwluvw

clwluvw commented Feb 21, 2025 •

Copy link
Copy Markdown
Member Author

BTW: I wonder whether there is a way a client (or just a cls) can hint a compaction to happen. I doubt we have any interface for that in place but the idea seems interesting.

Doesn’t this fall into the following fact from: https://rocksdb.org/blog/2018/11/21/delete-range.html#existing-mechanisms-challenges-and-opportunities

Another common pattern is using a custom compaction filter that drops keys in the deleted range(s). This deletes the range asynchronously, so cannot be used in cases where readers must not see keys in deleted ranges. Further, it has the disadvantage of outputting tombstones to all but the bottom level. That’s because compaction cannot detect whether dropping a key would cause an older version at a lower level to reappear.

(void) CLSRGWIssueBucketIndexClean(index_pool,
bucket_objs,
cct->_conf->rgw_bucket_index_max_aio)();
cct->_conf->rgw_clean_bucket_index_max_aio)();

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.

Apart of better index cleanup configurability this effectively changes the default value (from 128 to 1). Is this really intended?

@rzarzynski

Copy link
Copy Markdown
Contributor

@markhpc: any free cycles to reverify-after-the-years?

@github-actions

github-actions Bot commented Apr 4, 2025

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 commented Jun 4, 2025

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 Jun 4, 2025
@clwluvw clwluvw removed the stale label Jun 4, 2025
@github-actions

github-actions Bot commented Aug 3, 2025

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 Aug 3, 2025
@clwluvw clwluvw 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
@clwluvw clwluvw removed the stale label Oct 12, 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 Dec 11, 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 Jan 10, 2026
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.

5 participants