Skip to content

rgw/restore: run shard hash through HASH_PRIME - #69373

Merged
soumyakoduri merged 1 commit into
ceph:mainfrom
mheler:wip-rgw-restore-queue-shard-fix
Jun 19, 2026
Merged

soumyakoduri merged 1 commit into
ceph:mainfrom
mheler:wip-rgw-restore-queue-shard-fix

Conversation

@mheler

@mheler mheler commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Restoring a bucket full of numeric-id object names put every entry on the same shard. The low bits of ceph_str_hash_linux are weak for digit-only names, and the mod-32 shard selection only looks at those bits.. LC already runs the hash through % HASH_PRIME before % max_objs to avoid exactly this, so do the same here.

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

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

choose_oid fed ceph_str_hash_linux straight into % max_objs, and the
low bits of that hash are weak enough that similar object names keep
landing on the same shard. LC takes the hash mod HASH_PRIME first for
exactly this reason, do the same here.

Signed-off-by: Matthew N. Heler <[email protected]>
@mheler
mheler requested a review from soumyakoduri June 9, 2026 23:43
@mheler
mheler requested a review from a team as a code owner June 9, 2026 23:43
@github-actions github-actions Bot added the rgw label Jun 9, 2026
@anrao19

anrao19 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich , more details : https://tracker.ceph.com/issues/77460.
@mheler, if no further testing is need. This pr can be merged

@soumyakoduri
soumyakoduri merged commit 5a3b87a into ceph:main Jun 19, 2026
7 checks passed
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.

3 participants