Repository navigation
osd/SnapMapper::update_snaps() to handle a missing OBJ_ record - #68707
Merged
Merged
Conversation
ronen-fr
force-pushed
the
wip-rf-smapper-addoid
branch
from
May 1, 2026 07:53
154769f to
9265eeb
Compare
ronen-fr
marked this pull request as ready for review
May 1, 2026 07:53
Matan-B
approved these changes
May 4, 2026
| @@ -589,6 +589,13 @@ int SnapMapper::update_snaps( | |||
| // Tolerate missing keys but not disk errors | |||
| if (r < 0 && r != -ENOENT) | |||
| return r; | |||
| if (r == -ENOENT) { | |||
| // no existing mapping — create from scratch | |||
Contributor
There was a problem hiding this comment.
nit, more verbose version. wdyt?
// Recently recovered replicas may observe missing snap-mapper state.
// Avoid creating an inconsistent state (OBJ_ without matching SNA_ entries) that
// would be detected by scrub later on - instead rebuild the mapping from scratch.
ronen-fr
force-pushed
the
wip-rf-smapper-addoid
branch
3 times, most recently
from
May 5, 2026 03:39
37cf251 to
d1b041e
Compare
by falling back to add_oid() instead of silently creating an inconsistent state (OBJ_ without matching SNA_ entries). This was observed on replicas that had recently recovered objects: the snap mapper entries created during recovery were not visible to a subsequent snap-trim repop's update_snaps() call, leaving the clone with no snap mapper entries. Scrub would then detect and report the inconsistency as an error. Promote snap mapper remove_oid/clear_snaps logging to dout(10) and add apply_op_stats tracing to aid diagnosis of any remaining stat or snap mapper drift. Signed-off-by: Ronen Friedman <[email protected]>
Contributor
Author
|
jenkins test windows |
Contributor
Author
|
jenkins test make check arm64 |
Contributor
Author
|
Passed Teuthology tests (multiple branch names. Latest: wip-rf-smapper-addoid-again). |
Contributor
Author
|
jenkins test windows |
ronen-fr
force-pushed
the
wip-rf-smapper-addoid
branch
from
May 6, 2026 04:19
d1b041e to
ac06cb5
Compare
Contributor
Author
|
A post-merge comment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update_snaps() to handle a missing OBJ_ record
by falling back to add_oid() instead of silently creating an
inconsistent state (OBJ_ without matching SNA_ entries). This
was observed on replicas that had recently recovered objects:
the snap mapper entries created during recovery were not visible
to a subsequent snap-trim repop's update_snaps() call, leaving
the clone with no snap mapper entries. Scrub would then detect
and report the inconsistency as an error.
Promote snap mapper remove_oid/clear_snaps logging to dout(10)
and add apply_op_stats tracing to aid diagnosis of any remaining
stat or snap mapper drift.
Details:
add_oid() always creates both OBJ_ and SNA_ entries.
update_snaps() only diffs against existing SNA_ entries.
When there are no existing entries, update_snaps() must
delegate to add_oid() to avoid the OBJ_/SNA_ inconsistency.
Take https://pulpito.ceph.com/rfriedma-2026-04-30_04:51:15-rados:thrash-wip-rf-stqlength-distro-default-trial/187081/
as an example. Bug scenario:
With this fix: