]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cache: workaround to drop delta with mismatched crc
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 24 Aug 2022 02:51:56 +0000 (10:51 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 24 Aug 2022 03:04:04 +0000 (11:04 +0800)
The workaround is unreliable to identify whether the delta is out-dated,
need to drop it once the paddr->journal_seq_t mapping is introduced.

Note: this issue only happens with journal_type_t::CIRCULAR.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/async_cleaner.h
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/extent_placement_manager.h

index 1cc231ae2d84ce2c5a4341ce05815c83b9d00e54..b431cb118975db2938d4c5a89e0e4415bd077613 100644 (file)
@@ -840,6 +840,10 @@ public:
     return *ool_segment_seq_allocator;
   }
 
+  journal_type_t get_journal_type() const {
+    return journal_type;
+  }
+
   void set_extent_callback(ExtentCallbackInterface *cb) {
     ecb = cb;
   }
index beab454ee9df468d076054aa0ed2d527b5649dc9..8bed316a2d598d03abce9518422b416724e1ecd9 100644 (file)
@@ -1757,9 +1757,18 @@ Cache::replay_delta(
       DEBUG("replay extent delta at {} {} ... -- {}, prv_extent={}",
             journal_seq, record_base, delta, *extent);
 
-      assert(extent->version == delta.pversion);
+      if (extent->last_committed_crc != delta.prev_crc) {
+        // FIXME: we can't rely on crc to detect whether is delta is
+        // out-of-date.
+        ERROR("identified delta crc {} doesn't match the extent at {} {}, "
+              "probably is out-dated -- {}",
+              delta, journal_seq, record_base, *extent);
+        ceph_assert(epm.get_journal_type() == journal_type_t::CIRCULAR);
+        remove_extent(extent);
+        return replay_delta_ertr::make_ready_future<bool>(false);
+      }
 
-      assert(extent->last_committed_crc == delta.prev_crc);
+      assert(extent->version == delta.pversion);
       extent->apply_delta_and_adjust_crc(record_base, delta.bl);
       extent->set_modify_time(modify_time);
       assert(extent->last_committed_crc == delta.final_crc);
index d5b39854c15c9668a12d668f4eb1102a60a010f1..60b3e2476db94f73add3796a7fbf92780a6ea9b4 100644 (file)
@@ -98,6 +98,10 @@ public:
     cleaner->set_extent_callback(cb);
   }
 
+  journal_type_t get_journal_type() const {
+    return cleaner->get_journal_type();
+  }
+
   seastore_off_t get_block_size() const {
     assert(primary_device != nullptr);
     // assume all the devices have the same block size