]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/journal: move segment rolling asserts to ceph_asserts
authorYingxin Cheng <yingxin.cheng@intel.com>
Mon, 27 Feb 2023 08:18:26 +0000 (16:18 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Mon, 27 Feb 2023 08:57:10 +0000 (16:57 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/journal/segment_allocator.cc

index 05d29d7532463b3b72b3b4fb426f30c916823057..5aeaad05c942b36efa0339f6a2bc29f132ea3302 100644 (file)
@@ -468,11 +468,11 @@ RecordSubmitter::roll_segment_ertr::future<>
 RecordSubmitter::roll_segment()
 {
   LOG_PREFIX(RecordSubmitter::roll_segment);
-  assert(p_current_batch->needs_flush() ||
-         is_available());
+  ceph_assert(p_current_batch->needs_flush() ||
+              is_available());
   // #1 block concurrent submissions due to rolling
   wait_available_promise = seastar::shared_promise<>();
-  assert(!wait_unfull_flush_promise.has_value());
+  ceph_assert(!wait_unfull_flush_promise.has_value());
   return [FNAME, this] {
     if (p_current_batch->is_pending()) {
       if (state == state_t::FULL) {
@@ -529,7 +529,7 @@ RecordSubmitter::submit(
     bool with_atomic_roll_segment)
 {
   LOG_PREFIX(RecordSubmitter::submit);
-  assert(is_available());
+  ceph_assert(is_available());
   assert(check_action(record.size) != action_t::ROLL);
   segment_allocator.get_provider().update_modify_time(
       segment_allocator.get_segment_id(),
@@ -585,7 +585,7 @@ RecordSubmitter::submit(
         assert(p_current_batch->is_pending());
       } else {
         wait_available_promise = seastar::shared_promise<>();
-        assert(!wait_unfull_flush_promise.has_value());
+        ceph_assert(!wait_unfull_flush_promise.has_value());
         wait_unfull_flush_promise = seastar::promise<>();
         // flush and mark available in background
         std::ignore = wait_unfull_flush_promise->get_future(
@@ -675,14 +675,14 @@ RecordSubmitter::open(bool is_mkfs)
 RecordSubmitter::close_ertr::future<>
 RecordSubmitter::close()
 {
-  assert(state == state_t::IDLE);
-  assert(num_outstanding_io == 0);
+  ceph_assert(state == state_t::IDLE);
+  ceph_assert(num_outstanding_io == 0);
   committed_to = JOURNAL_SEQ_NULL;
-  assert(p_current_batch != nullptr);
-  assert(p_current_batch->is_empty());
-  assert(!wait_available_promise.has_value());
+  ceph_assert(p_current_batch != nullptr);
+  ceph_assert(p_current_batch->is_empty());
+  ceph_assert(!wait_available_promise.has_value());
   has_io_error = false;
-  assert(!wait_unfull_flush_promise.has_value());
+  ceph_assert(!wait_unfull_flush_promise.has_value());
   metrics.clear();
   return segment_allocator.close();
 }
@@ -719,7 +719,7 @@ void RecordSubmitter::decrement_io_with_flush()
       return;
     }
   } else {
-    assert(!wait_unfull_flush_promise.has_value());
+    ceph_assert(!wait_unfull_flush_promise.has_value());
   }
 
   auto needs_flush = (