]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/SnapMapper: Clarify key formats 65525/head
authorMatan Breizman <mbreizma@redhat.com>
Wed, 17 Sep 2025 09:12:00 +0000 (09:12 +0000)
committerethanwu <ethanwu@synology.com>
Thu, 18 Sep 2025 01:38:55 +0000 (09:38 +0800)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/osd/SnapMapper.cc

index d9d27dfabc69233965927d3bf1025432159b600d..bdf78bcca7ea7e1b82bb614adfe08121c8fc2f35 100644 (file)
@@ -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<snapid_t> }
 
+  -----
+
+  Key formats when shard exists (EC):
+
+  <SNA_><pool>_<snapid>_.<shardid>_<hobject_t::to_str()>
+
+  <OBJ_>_.<shardid>_<hobject_t::to_str()>
+
+  Otherwise, for shard_id_t::NO_SHARD (Replicated):
+
+  <SNA_><pool>_<snapid>_<hobject_t::to_str()>
+
+  <OBJ_>_<hobject_t::to_str()>
+
+
   */
 
 #ifdef WITH_CRIMSON