]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/backref: prevent backref extents from causing transaction conflicts
authorXuehan Xu <xxhdx1985126@gmail.com>
Tue, 22 Feb 2022 09:43:25 +0000 (17:43 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Sun, 24 Apr 2022 01:34:28 +0000 (09:34 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/backref/backref_tree_node.h
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index 81977462da110fccbec30f88fd9cc8ec430e8de1..316787830a1c472a458903dfe742d8c620cf3a90 100644 (file)
@@ -65,6 +65,10 @@ public:
   extent_types_t get_type() const final {
     return TYPE;
   }
+
+  bool may_conflict() const final {
+    return false;
+  }
 };
 using BackrefInternalNodeRef = BackrefInternalNode::Ref;
 
@@ -86,6 +90,10 @@ public:
     return TYPE;
   }
 
+  bool may_conflict() const final {
+    return false;
+  }
+
   const_iterator insert(
     const_iterator iter,
     paddr_t key,
index c037c062526ad26fc3e93c92fcc1c626ec062eef..5b031457f2cb612ae93b0ed159a2597551dd327c 100644 (file)
@@ -718,6 +718,11 @@ void Cache::invalidate_extent(
     Transaction& t,
     CachedExtent& extent)
 {
+  if (!extent.may_conflict()) {
+    assert(extent.transactions.empty());
+    return;
+  }
+
   LOG_PREFIX(Cache::invalidate_extent);
   bool do_conflict_log = true;
   for (auto &&i: extent.transactions) {
index 1ec2b2fd8cd50fdc7d58867ce1f42a42021876f2..f0b88133d3e7779942e3acd26b8a165f45bcb932 100644 (file)
@@ -192,6 +192,10 @@ public:
     return false;
   }
 
+  virtual bool may_conflict() const {
+    return true;
+  }
+
   friend std::ostream &operator<<(std::ostream &, extent_state_t);
   virtual std::ostream &print_detail(std::ostream &out) const { return out; }
   std::ostream &print(std::ostream &out) const {