From 7380fcbad3818ae9d403a89870bbad45bec512dd Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Mon, 27 Feb 2023 16:18:26 +0800 Subject: [PATCH] crimson/os/seastore/journal: move segment rolling asserts to ceph_asserts Signed-off-by: Xuehan Xu Signed-off-by: Yingxin Cheng --- .../os/seastore/journal/segment_allocator.cc | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/crimson/os/seastore/journal/segment_allocator.cc b/src/crimson/os/seastore/journal/segment_allocator.cc index 05d29d75324..5aeaad05c94 100644 --- a/src/crimson/os/seastore/journal/segment_allocator.cc +++ b/src/crimson/os/seastore/journal/segment_allocator.cc @@ -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 = ( -- 2.39.5