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>
{
unsigned long long p, s;
long sh;
- int r = sscanf(key.data(), "SNA_%lld_%llx.%lx", &p, &s, &sh);
- if (r != 1) {
+ int r = sscanf(key.data(), "SNA_%lld_%llx_.%lx", &p, &s, &sh);
+ if (r != 3) {
shard = shard_id_t::NO_SHARD;
} else {
shard = shard_id_t(sh);