]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cached_extent: cleanups and comments
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 1 Aug 2024 06:59:35 +0000 (14:59 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 1 Aug 2024 07:51:59 +0000 (15:51 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cached_extent.h

index 1d6ffc740cb818d41c806fb531100b5f9468b24c..e5e32b6713b1e0fa43848079e77bd6207f803863 100644 (file)
@@ -343,6 +343,8 @@ public:
       : "nullopt";
     out << "CachedExtent(addr=" << this
        << ", type=" << get_type()
+       << ", trans=" << pending_for_transaction
+       << ", pending_io=" << is_pending_io()
        << ", version=" << version
        << ", dirty_from_or_retired_at=" << dirty_from_or_retired_at
        << ", modify_time=" << sea_time_point_printer_t{modify_time}
@@ -440,14 +442,18 @@ public:
       state == extent_state_t::DIRTY;
   }
 
+  bool is_stable_writting() const {
+    // MUTATION_PENDING and under-io extents are already stable and visible,
+    // see prepare_record().
+    //
+    // XXX: It might be good to mark this case as DIRTY from the definition,
+    // which probably can make things simpler.
+    return is_mutation_pending() && is_pending_io();
+  }
+
   /// Returns true if extent is stable and shared among transactions
   bool is_stable() const {
-    return is_stable_written() ||
-          // MUTATION_PENDING and under-io extents are to-be-stable extents,
-          // for the sake of caveats that checks the correctness of extents
-          // states, we consider them stable.
-           (is_mutation_pending() &&
-            is_pending_io());
+    return is_stable_written() || is_stable_writting();
   }
 
   bool is_data_stable() const {