Commit 699e87d3 authored by Yossi Gottlieb's avatar Yossi Gottlieb
Browse files

Fix: never revert term due to a snapshot.

parent 0990cf7b
......@@ -1486,6 +1486,7 @@ int raft_begin_load_snapshot(
if (last_included_term == me->snapshot_last_term && last_included_index == me->snapshot_last_idx)
return RAFT_ERR_SNAPSHOT_ALREADY_LOADED;
if (me->current_term < last_included_term)
me->current_term = last_included_term;
me->voted_for = -1;
raft_set_state((raft_server_t*)me, RAFT_STATE_FOLLOWER);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment