Skip to content

Commit

Permalink
use the name sync truncate for the fast forward api
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravi Nagarjun Akella authored and Ravi Nagarjun Akella committed Feb 28, 2024
1 parent dafb1b6 commit 1407efb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/homelogstore/log_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void HomeLogStore::truncate(const logstore_seq_num_t upto_seq_num, const bool in
if (locked_now) { m_logdev.unlock_flush(); }
}

void HomeLogStore::fast_forward(const logstore_seq_num_t upto_seq_num, const bool in_memory_truncate_only) {
void HomeLogStore::sync_truncate(const logstore_seq_num_t upto_seq_num, const bool in_memory_truncate_only) {
// Check if we need to fill any gaps in the logstore
auto const last_idx{get_contiguous_issued_seq_num(std::max(0l, truncated_upto()))};
HS_REL_ASSERT_GE(last_idx, 0l, "Negative sequence number: {} [Logstore id ={}]", last_idx, m_store_id);
Expand Down Expand Up @@ -291,7 +291,7 @@ void HomeLogStore::do_truncate(const logstore_seq_num_t upto_seq_num, const bool
m_records.truncate(upto_seq_num);
m_safe_truncation_boundary.seq_num.store(upto_seq_num, std::memory_order_release);

// Need to update the superblock with meta, we don't persist yet, will be done as part of log dev truncation
// Need to update the superblock with meta, in case we don't persist yet, will be done as part of log dev truncation
m_logdev.update_store_superblk(m_store_id, logstore_superblk{upto_seq_num + 1}, persist_now /* persist_now */);

const int ind{search_max_le(upto_seq_num)};
Expand Down
2 changes: 1 addition & 1 deletion src/homelogstore/log_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class HomeLogStore : public std::enable_shared_from_this< HomeLogStore > {
* This API makes sure the log idx is durable after the truncation.
* See above truncate method for more details on parameters
*/
void fast_forward(const logstore_seq_num_t upto_seq_num, const bool in_memory_truncate_only = true);
void sync_truncate(const logstore_seq_num_t upto_seq_num, const bool in_memory_truncate_only = true);

/**
* @brief Fill the gap in the seq_num with a dummy value. This ensures that get_contiguous_issued and completed
Expand Down
2 changes: 1 addition & 1 deletion src/homelogstore/tests/test_log_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ TEST_F(LogStoreTest, TruncateDurability) {
// fast_forward should be resilient to crashe and should be able to recover

uint64_t fast_forward_upto{350};
_hs_log_store->fast_forward(fast_forward_upto);
_hs_log_store->sync_truncate(fast_forward_upto);
#ifdef _PRERELEASE
flip::FlipFrequency freq1;
freq1.set_count(1);
Expand Down

0 comments on commit 1407efb

Please sign in to comment.