]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/onode_manager: populate value recorders of onodes to 53966/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 6 Sep 2023 06:56:51 +0000 (14:56 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 22 Oct 2023 08:33:42 +0000 (08:33 +0000)
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>
(cherry picked from commit 6c236bb63a9a49c7f9e2dab03a5fe0bb016560f0)

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);
 }