Skip to content

Commit

Permalink
Faster recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Dec 24, 2024
1 parent ccccbf6 commit 7310b1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/raft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ void TRaft::ProcessTimeout(ITimeSource::Time now) {

VolatileState = std::move(nextVolatileState);
StateName = EState::LEADER;

// Add fake empty entry for faster commit
//
{
auto empty = NewHoldedMessage<TLogEntry>();
empty->Term = State->CurrentTerm;
State->Append(std::move(empty));
}
}
}

Expand Down

0 comments on commit 7310b1b

Please sign in to comment.