Skip to content

crimson/osd: fix PG splitting logic during map gaps - #67225

Merged
Matan-B merged 3 commits into
ceph:mainfrom
amathuria:wip-amat-fix-74504
Mar 4, 2026
Merged

Matan-B merged 3 commits into
ceph:mainfrom
amathuria:wip-amat-fix-74504

Conversation

@amathuria

@amathuria amathuria commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

When the OSD advances through a range of maps (map gap), it must ensure that every epoch transition is evaluated for potential PG splits.

This patch updates the split check to use the last OSDMap epoch from the PG as the baseline for each step. This guarantees that splits are checked consecutively for every map in the sequence, preventing intermediate splits from being missed during map gap.

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

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 marked this pull request as ready for review February 9, 2026 10:35
@amathuria
amathuria requested a review from a team as a code owner February 9, 2026 10:35
@Matan-B Matan-B added this to Crimson Feb 9, 2026
@Matan-B Matan-B moved this to Awaits review in Crimson Feb 9, 2026
pg->handle_advance_map(next_map, rctx);
return check_for_splits(*from, next_map);
// Use the last OSDMap epoch to check for splits consecutively.
epoch_t last_epoch = pg->get_osdmap_epoch();

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, current_epoch

@Matan-B Matan-B moved this from Awaits review to Needs QA in Crimson Feb 9, 2026
@Matan-B

Matan-B commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Can we enable pg splits in the rados tests where it was disabled with this fix?

@amathuria

Copy link
Copy Markdown
Contributor Author

Can we enable pg splits in the rados tests where it was disabled with this fix?

From my testing, this PR fixes https://tracker.ceph.com/issues/74504 which was easy to test because it was occurring frequently.
Regarding https://tracker.ceph.com/issues/74503, I have not encountered it again in my testing but taking a look at the logs I think it's a deeper issue than OSD mapgap handling.
In my opinion, this should not stop us from enabling pg splits in the tests where we disabled it. If we encounter the issue again, we can take a further look.
How does that sound to you? I can add a commit here to enable the tests.

@Matan-B

Matan-B commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

From my testing, this PR fixes https://tracker.ceph.com/issues/74504 which was easy to test because it was occurring frequently. Regarding https://tracker.ceph.com/issues/74503, I have not encountered it again in my testing but taking a look at the logs I think it's a deeper issue than OSD mapgap handling. In my opinion, this should not stop us from enabling pg splits in the tests where we disabled it. If we encounter the issue again, we can take a further look. How does that sound to you? I can add a commit here to enable the tests.

I'm ok with both options! Your call :)

@amathuria

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@amathuria
amathuria force-pushed the wip-amat-fix-74504 branch 2 times, most recently from 8d79c11 to eb7733d Compare February 24, 2026 14:01

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.

In BlueStore's path, the sequential processing means the last split_collection call
(highest bits child) sets the final parent bits.
In SeaStore with parallel_for_each, separate transactions race, and a lower-bits child can overwrite the correct value.

Both Store's transaction processing must be ordered and serialized. SeaStore allows concurrent transactions for diffrent pgs (no 2 concurrent transactions for the same pg/coll) - which could perhaps expose the issue mentioned above(?).
Regardless, serializing split_children iteration looks like a better approach 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.

Yes that's correct. The issue was exposed because due to concurrent transactions for the children pgs.

When the OSD advances through a range of maps (map gap), it must
ensure that every epoch transition is evaluated for potential
PG splits.

This patch updates the split check to use the current OSDMap epoch
from the PG as the baseline for each step. This guarantees that
splits are checked consecutively for every map in the sequence,
preventing intermediate splits from being missed during map gap.

Fixes: https://tracker.ceph.com/issues/74504
Signed-off-by: Aishwarya Mathuria <[email protected]>
…orkloads"

This reverts commit 1ce8bf5.

Signed-off-by: Aishwarya Mathuria <[email protected]>
Currently, we use parallel_for_each when splitting a PG into multiple children.
In BlueStore's path, the sequential processing means the last split_collection call
(highest bits child) sets the final parent bits.
In SeaStore with parallel_for_each, separate transactions race, and a lower-bits child can overwrite the correct value.
With incorrect split_bits, the parent PG's list_objects computes a wider hash range than it should,
causing do_delete_work to list and delete objects that actually belong to a child PG.
When that child later tries to access those objects, SeaStore hits an unexpected ENOENT and aborts.

Fixes: https://tracker.ceph.com/issues/74982
Signed-off-by: Aishwarya Mathuria <[email protected]>
@amathuria

Copy link
Copy Markdown
Contributor Author

@Matan-B

Matan-B commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/amathuri-2026-02-26_10:12:21-crimson-rados:thrash-wip-amat-fix-74504-distro-debug-trial/ - all passed

However, this build did include #67488. @Matan-B Since we were seeing https://tracker.ceph.com/issues/70501 frequently with pggrow tests, maybe we can merge this PR after #67488 goes in?

This bug seems to block other seastore PRs, I think we can merge without waiting :)

@Matan-B
Matan-B merged commit 396b3b6 into ceph:main Mar 4, 2026
6 checks passed
@Matan-B Matan-B moved this from Needs QA to Merged (Main) in Crimson Mar 4, 2026
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/22671664713

@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
        This is an automated message by src/script/redmine-upkeep.py.

        I found one or more `Fixes:` tags in the commit messages in

        `git log 396b3b672ab3e80a2a01120f5f599ece478f34dc^..396b3b672ab3e80a2a01120f5f599ece478f34dc`

        The referenced tickets are:

        * https://tracker.ceph.com/issues/74504

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

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

2 participants