Repository navigation
osd/SnapMapper: fix SnapMapper::Scrubber shard parsing - #65525
Merged
Merged
Conversation
Contributor
|
@Matan-B - can you comment on this (and the probably-wrong tracker)? |
Matan-B
approved these changes
Sep 17, 2025
Contributor
There was a problem hiding this comment.
Great catch, we should backport this.
Suggesting the following commit message since this area is delicate:
osd/SnapMapper: fix SnapMapper::Scrubber pg shard parsing
Note: the following only applies to EC pools as replicated pools have no shard in the SNA_ keys.
Note: The Scrubber is only responsible for clearing entries that (_for some anomalous reason_) remained in the store and should have been purged.
SnapMapper::Scrubber::_parse_m is using the wrong key format (See: napMapper::get_prefix) to obtain the pg shard.
While the correct format in EC pgs is:
<MAPPING_PREFIX><pool>_<snapid>_.<shardid>_<hobject_t::to_str()>
*******************************^
Or in replicated case:
<MAPPING_PREFIX><pool>_<snapid>_<hobject_t::to_str()>
*******************************^
The Scrubber is parsing the key a `.` instead of `_.`
---
`sscanf` should return the 3 if the third parameter (shard) was successfully parsed.
Otherwise, we assume no shard is present in this key.
Fixes: https://tracker.ceph.com/issues/73018
Signed-off-by: ethanwu <[email protected]>
Probably a good opportunity to clarify this format nuance in the comments above, I'll edit and cherry-pick here.
Contributor
Thanks for pinging, I've updated the comments as well. |
ethanwu-syno
force-pushed
the
fix-snapper-parse-m
branch
from
September 17, 2025 09:58
8b4d76e to
4332e94
Compare
Contributor
Author
Update git commit message as suggested, thanks |
ronen-fr
approved these changes
Sep 17, 2025
rzarzynski
approved these changes
Sep 17, 2025
Note: the following only applies to EC pools as replicated pools have no shard in the SNA_ keys. Note: The Scrubber is only responsible for clearing entries that (_for some anomalous reason_) remained in the store and should have been purged. SnapMapper::Scrubber::_parse_m is using the wrong key format (See: napMapper::get_prefix) to obtain the pg shard. While the correct format in EC pgs is: <MAPPING_PREFIX><pool>_<snapid>_.<shardid>_<hobject_t::to_str()> *******************************^ Or in replicated case: <MAPPING_PREFIX><pool>_<snapid>_<hobject_t::to_str()> *******************************^ The Scrubber is parsing the key a `.` instead of `_`. --- `sscanf` should return the 3 if the third parameter (shard) was successfully parsed. Otherwise, we assume no shard is present in this key. Fixes: https://tracker.ceph.com/issues/73018 Signed-off-by: ethanwu <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
ethanwu-syno
force-pushed
the
fix-snapper-parse-m
branch
from
September 18, 2025 01:42
4332e94 to
1de607b
Compare
4 of 14 tasks
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.
From the comment at the beginning of the file
the format for snapshot+obj to obj
should be
SNA_%lld_%llx_.%lx rather than SNA_%lld_%llx.%lx in parse_m
the check for sscanf return value is also incorrect,
it returns the number of input items successfully matched and assigned.
before fix,
we always get shard 255(NO_SHARD)
snap_mapper _parse_m mapping pool 4 snap b shard 255 4:0063648e:::1000000026b.00000000:b
but for erase pool object, it will have shard
snap_mapper _parse_m mapping pool 4 snap b shard 0 4:0063648e:::1000000026b.00000000:b
Fixes: https://tracker.ceph.com/issues/73018
Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition