Skip to content

Commit

Permalink
Add proper state into rreq when replaying.
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxi Chen <[email protected]>
  • Loading branch information
xiaoxichen committed Sep 23, 2024
1 parent 664c882 commit db70292
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,12 @@ void RaftReplDev::on_log_found(logstore_seq_num_t lsn, log_buffer buf, void* ctx
// keep lentry in scope for the lyfe cycle of the rreq
rreq->set_lentry(lentry);
rreq->init(rkey, jentry->code, false /* is_proposer */, entry_to_hdr(jentry), entry_to_key(jentry), data_size);
// we load the log from log device, implies log flushed. We only flush log after data is written to data device.
rreq->add_state(repl_req_state_t::BLK_ALLOCATED);
rreq->add_state(repl_req_state_t::DATA_RECEIVED);
rreq->add_state(repl_req_state_t::DATA_WRITTEN);
rreq->add_state(repl_req_state_t::LOG_RECEIVED);
rreq->add_state(repl_req_state_t::LOG_FLUSHED);
RD_LOGD("Replay log on restart, rreq=[{}]", rreq->to_string());

if (repl_lsn > m_rd_sb->durable_commit_lsn) {
Expand Down

0 comments on commit db70292

Please sign in to comment.