diff --git a/src/llfs/page_allocator_state.cpp b/src/llfs/page_allocator_state.cpp index 9ba8ddc..5b06c08 100644 --- a/src/llfs/page_allocator_state.cpp +++ b/src/llfs/page_allocator_state.cpp @@ -568,14 +568,14 @@ void run_ref_count_update_sanity_checks(const PageIdFactory& id_factory, << BATT_INSPECT(new_count) << ")" << BATT_INSPECT(delta_generation) << BATT_INSPECT(index); }; - LLFS_VLOG(2) << "rrcusc: " << debug_info; + LLFS_VLOG(2) << debug_info; BATT_CHECK_GE(old_count, 0) << "ref counts must be non-negative" << debug_info; BATT_CHECK_GE(new_count, 0) << "ref counts must be non-negative" << debug_info; if (old_count == new_count) { BATT_CHECK_EQ(delta.ref_count, 0) - << "delta was non-zero but count did not change (bbora)" << debug_info; + << "delta was non-zero but count did not change" << debug_info; return; } diff --git a/src/llfs/page_recycler.cpp b/src/llfs/page_recycler.cpp index 5323a26..bc4025b 100644 --- a/src/llfs/page_recycler.cpp +++ b/src/llfs/page_recycler.cpp @@ -73,7 +73,8 @@ StatusOr refresh_recycler_info_slot(TypedSlotWriter /*static*/ u64 PageRecycler::calculate_log_size(const PageRecyclerOptions& options, Optional max_buffered_page_count) { - const usize log_size_raw = calculate_log_size_no_padding(options, max_buffered_page_count); + const usize log_size_raw = + PageRecycler::calculate_log_size_no_padding(options, max_buffered_page_count); const usize padding_bytes = 1 * kKiB; return round_up_to_page_size_multiple(log_size_raw + padding_bytes); @@ -175,7 +176,7 @@ StatusOr refresh_recycler_info_slot(TypedSlotWriter return std::unique_ptr{ new PageRecycler(scheduler, std::string{name}, page_deleter, std::move(*recovered_log), - std::move(latest_batch), std::move(state), visitor.largest_offset())}; + std::move(latest_batch), std::move(state), visitor.largest_unique_offset())}; } //==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - @@ -184,7 +185,7 @@ PageRecycler::PageRecycler(batt::TaskScheduler& scheduler, const std::string& na PageDeleter& page_deleter, std::unique_ptr&& wal_device, Optional&& recovered_batch, std::unique_ptr&& state, - u64 largest_offset_as_unique_identifier_init) noexcept + llfs::slot_offset_type largest_offset_as_unique_identifier_init) noexcept : scheduler_{scheduler} , name_{name} , page_deleter_{page_deleter} @@ -329,7 +330,8 @@ StatusOr PageRecycler::recycle_pages( LLFS_VLOG(1) << "PageRecycler::recycle_pages(page_ids=" << batt::dump_range(page_ids) << "[" << page_ids.size() << "]" << ", grant=[" << (grant ? grant->size() : usize{0}) << "], depth=" << depth << ") " - << this->name_ << BATT_INSPECT(offset_as_unique_identifier); + << this->name_ << BATT_INSPECT(offset_as_unique_identifier) + << BATT_INSPECT(this->largest_offset_as_unique_identifier_); if (page_ids.empty()) { return this->wal_device_->slot_range(LogReadMode::kDurable).upper_bound; diff --git a/src/llfs/page_recycler_recovery_visitor.cpp b/src/llfs/page_recycler_recovery_visitor.cpp index 2d68768..4dd3e77 100644 --- a/src/llfs/page_recycler_recovery_visitor.cpp +++ b/src/llfs/page_recycler_recovery_visitor.cpp @@ -114,7 +114,7 @@ Optional PageRecyclerRecoveryVisitor::latest_info_refresh_slot() cons //==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - // -u64 PageRecyclerRecoveryVisitor::largest_offset() const +slot_offset_type PageRecyclerRecoveryVisitor::largest_unique_offset() const { return this->largest_offset_as_unique_identifier_; } diff --git a/src/llfs/page_recycler_recovery_visitor.hpp b/src/llfs/page_recycler_recovery_visitor.hpp index 5d81d16..2b74942 100644 --- a/src/llfs/page_recycler_recovery_visitor.hpp +++ b/src/llfs/page_recycler_recovery_visitor.hpp @@ -45,7 +45,7 @@ class PageRecyclerRecoveryVisitor Optional latest_info_refresh_slot() const; - u64 largest_offset() const; + slot_offset_type largest_unique_offset() const; //+++++++++++-+-+--+----- --- -- - - - - @@ -82,7 +82,9 @@ class PageRecyclerRecoveryVisitor */ Optional latest_info_refresh_slot_; - u64 largest_offset_as_unique_identifier_; + // This is to track largest unique_offset value during recovery. + // + slot_offset_type largest_offset_as_unique_identifier_; }; } // namespace llfs