Skip to content

crimson/osd: prime merge participants before map advance - #70110

Open
amathuria wants to merge 1 commit into
ceph:mainfrom
amathuria:wip-amat-crimson-prime-merges
Open

amathuria wants to merge 1 commit into
ceph:mainfrom
amathuria:wip-amat-crimson-prime-merges

Conversation

@amathuria

@amathuria amathuria commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Classic OSD runs prime_merges() in consume_map() before PGs advance so merge targets exist locally when a source calls register_merge_source().

Crimson lacked this, which could cause an assert or a hang during pg_num shrink when the target PG was not yet loaded in pg_map. This is most likely when pgp_num changes alongside pg_num: CRUSH remaps PG placement per the pool's crush rule, so a merge target can land on this OSD without a local PG object having been created yet.

Derive merge participants from the OSDMap epoch range, create empty placeholders via prime_merge_participant() before broadcast_map_to_pgs(), and back off gracefully when a target is still missing at handoff time.

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

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.

@amathuria
amathuria requested a review from a team as a code owner July 10, 2026 11:08
@amathuria amathuria moved this to Awaits review in Crimson Jul 10, 2026
@amathuria
amathuria requested a review from tchaikov July 10, 2026 11:08

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

i think we need to address an off-by-1 bug =)

Comment thread src/crimson/osd/pg_shard_manager.cc Resolved
Comment thread src/crimson/osd/pg_shard_manager.cc Resolved
@amathuria
amathuria force-pushed the wip-amat-crimson-prime-merges branch 2 times, most recently from e3de597 to 29f55b4 Compare July 17, 2026 09:13
@amathuria
amathuria requested review from ronen-fr and tchaikov July 20, 2026 05:52
for (const auto& [poolid, pool] : cur->get_pools()) {
if (!prev->have_pg_pool(poolid)) {
continue;
}

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.

probably we should also skip the EC pools as well following the classic, like:

      // EC merge priming needs the real shard in each spg_t; the seeds
      // below are synthesized with NO_SHARD, which calc_pg_role() would
      // match by value on any shard this OSD holds.
      if (!pool.is_replicated()) {
        continue;
      }

if we decided not to support EC pools, we should assert(pool.is_replicated() here

@github-actions

github-actions Bot commented Oct 4, 2026

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 4, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

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 3, 2026
@amathuria amathuria reopened this Nov 11, 2026
Classic OSD runs prime_merges() in consume_map() before PGs advance so
merge targets exist locally when a source calls register_merge_source().

Crimson lacked this, which could cause an assert or a hang during pg_num
shrink when the target PG was not yet loaded in pg_map. This is most
likely when pgp_num changes alongside pg_num: CRUSH remaps PG placement
per the pool's crush rule, so a merge target can land on this OSD without
a local PG object having been created yet.

Derive merge participants from the OSDMap epoch range, create empty
placeholders via prime_merge_participant() before broadcast_map_to_pgs(),
and back off gracefully when a target is still missing at handoff time.

Fixes: https://tracker.ceph.com/issues/77629
Signed-off-by: Aishwarya Mathuria <[email protected]>
@amathuria
amathuria force-pushed the wip-amat-crimson-prime-merges branch from 29f55b4 to 69d259d Compare November 11, 2026 11:31
@github-actions github-actions Bot removed the stale label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Awaits review

Development

Successfully merging this pull request may close these issues.

2 participants