]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/SnapMapper: fix SnapMapper::Scrubber pg shard parsing
authorethanwu <ethanwu@synology.com>
Mon, 15 Sep 2025 08:36:54 +0000 (16:36 +0800)
committerethanwu <ethanwu@synology.com>
Thu, 18 Sep 2025 01:38:39 +0000 (09:38 +0800)
commit9dda7afd8d851f1424e4a819aaf0d41e29fb749f
tree703a304f2ca4a740bb5efef6ae078b796a9cab33
parent098432f31463e5e2daa61b096ea90a95d0acf338
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 <ethanwu@synology.com>
src/osd/SnapMapper.cc