]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/onode_manager: populate value recorders of onodes to 53305/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 6 Sep 2023 06:56:51 +0000 (14:56 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Mon, 11 Sep 2023 03:19:25 +0000 (11:19 +0800)
be erased

Otherwise, the following modification sequence with the same transaction
might lead to onode extents' crc inconsistency during journal replay:

1. modify the last mapping in an onode extent;
2. erase the last mapping in that onode extent.

During journal replay, if the first modification is not recorded in the
delta, the onode extent's content would be inconsistent with that before
the system reboot

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/onode_manager/staged-fltree/fltree_onode_manager.cc

index ba78cbf0b0b320768791f08e557ee3ddcf689a03..bff27ab65178652c427f89a60584e4d1352ad7ce 100644 (file)
@@ -120,6 +120,10 @@ FLTreeOnodeManager::erase_onode_ret FLTreeOnodeManager::erase_onode(
   OnodeRef &onode)
 {
   auto &flonode = static_cast<FLTreeOnode&>(*onode);
+  assert(flonode.is_alive());
+  if (flonode.status == FLTreeOnode::status_t::MUTATED) {
+    flonode.populate_recorder(trans);
+  }
   flonode.mark_delete();
   return tree.erase(trans, flonode);
 }