Skip to content

Commit

Permalink
take max on dc_lsn
Browse files Browse the repository at this point in the history
dc_lsn will be flushed by gc_reaper_thread as well.

Signed-off-by: Xiaoxi Chen <[email protected]>
  • Loading branch information
xiaoxichen committed Sep 28, 2024
1 parent 1753967 commit 770ae0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,9 @@ void RaftReplDev::cp_flush(CP* cp, cshared<ReplDevCPContext> ctx) {

std::unique_lock lg{m_sb_mtx};
m_rd_sb->compact_lsn = clsn;
m_rd_sb->durable_commit_lsn = lsn;
// dc_lsn is also flushed in flush_durable_commit_lsn()
// we need to take a max to avoid rolling back.
m_rd_sb->durable_commit_lsn = std::max(lsn, m_rd_sb->durable_commit_lsn);
m_rd_sb->checkpoint_lsn = lsn;
m_rd_sb->last_applied_dsn = dsn;
m_rd_sb.write();
Expand Down

0 comments on commit 770ae0e

Please sign in to comment.