]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: update snapmapper bits during pg splitting
authorAishwarya Mathuria <amathuri@redhat.com>
Thu, 21 Aug 2025 06:02:44 +0000 (06:02 +0000)
committerAishwarya Mathuria <amathuri@redhat.com>
Thu, 21 Aug 2025 13:58:27 +0000 (13:58 +0000)
SnapMapper bits for both parent and children PGs should be updated
during the splitting workflow

Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
src/crimson/osd/osd_operations/pg_advance_map.cc
src/crimson/osd/pg.h

index e5a7dcd8f9d4e83fc9f09ce2bbb42e8906c15849..88abfd6e9c71d167ffb8528adc35cbf2d0f53d17 100644 (file)
@@ -160,6 +160,9 @@ seastar::future<> PGAdvanceMap::split_pg(
   auto pg_epoch = next_map->get_epoch();
   DEBUG("{}: epoch: {}", *this, pg_epoch);
 
+  unsigned new_pg_num = next_map->get_pg_num(pg->get_pgid().pool());
+  pg->update_snap_mapper_bits(pg->get_pgid().get_split_bits(new_pg_num));
+
   co_await seastar::coroutine::parallel_for_each(split_children, [this, &next_map,
   pg_epoch, FNAME] (auto child_pgid) -> seastar::future<> {
     children_pgids.insert(child_pgid);
index 5a8a0707c95d9be2eb1751b7023c3c92460d8bb5..0b9b8e7451bfa307b31200d78e0fc92ee05be7f7 100644 (file)
@@ -602,6 +602,10 @@ public:
   void handle_activate_map(PeeringCtx &rctx);
   void handle_initialize(PeeringCtx &rctx);
 
+  void update_snap_mapper_bits(uint32_t bits) {
+    snap_mapper.update_bits(bits);
+  }
+
   void start_split_stats(const std::set<spg_t>& childpgs, std::vector<object_stat_sum_t> *out) {
     peering_state.start_split_stats(childpgs, out);
   }
@@ -631,6 +635,7 @@ public:
 
   void split_into(pg_t child_pgid, Ref<PG> child, unsigned split_bits) {
     peering_state.split_into(child_pgid, &child->peering_state, split_bits);
+    child->update_snap_mapper_bits(split_bits);
     child->snap_trimq = snap_trimq;
   }