From 1de607bda0363eef9c9292db8cb035b873ad078f Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Wed, 17 Sep 2025 09:12:00 +0000 Subject: [PATCH] osd/SnapMapper: Clarify key formats Signed-off-by: Matan Breizman --- src/osd/SnapMapper.cc | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/osd/SnapMapper.cc b/src/osd/SnapMapper.cc index d9d27dfabc692..bdf78bcca7ea7 100644 --- a/src/osd/SnapMapper.cc +++ b/src/osd/SnapMapper.cc @@ -56,20 +56,43 @@ const char *SnapMapper::PURGED_SNAP_PREFIX = "PSN_"; e.g., clean up on deletion). "SNA_" - + ("%lld" % poolid) - + "_" - + ("%016x" % snapid) - + "_" - + (".%x" % shard_id) - + "_" + + ("%lld" % poolid) + "_" + + + ("%016x" % snapid) + "_" + + // shard_id formatting is skipped for shard_id_t::NO_SHARD (See: make_shard_prefix) + + (".%x" % shard_id) + "_" + + hobject_t::to_str() ("%llx.%8x.%lx.name...." % pool, hash, snap) + -> SnapMapping::Mapping { snap, hoid } + ----- + "OBJ_" + + + // shard_id formatting is skipped for shard_id_t::NO_SHARD (See: make_shard_prefix) + (".%x" % shard_id) + + hobject_t::to_str() + -> SnapMapper::object_snaps { oid, set } + ----- + + Key formats when shard exists (EC): + + __._ + + _._ + + Otherwise, for shard_id_t::NO_SHARD (Replicated): + + __ + + _ + + */ #ifdef WITH_CRIMSON -- 2.39.5