Assert that terms in the log are monotonic

This commit is contained in:
Tyler Neely 2022-08-29 14:01:30 +00:00
parent b7e54cbe44
commit 28fae9e6d0

View File

@ -880,6 +880,7 @@ class Raft {
Log("handling WriteRequest");
// we are the leader. add item to log and send Append to peers
MG_ASSERT(state_.term >= LastLogTerm());
state_.log.emplace_back(std::pair(state_.term, std::move(req.operation)));
LogIndex log_index = state_.log.size() - 1;