Unverified Commit eb859a67 authored by Ozan Tezcan's avatar Ozan Tezcan Committed by GitHub
Browse files

Do not prevent election when snapshot is in progress (#86)

parent 0f2f98bc
...@@ -643,10 +643,7 @@ int raft_periodic(raft_server_t* me_, int msec_since_last_period) ...@@ -643,10 +643,7 @@ int raft_periodic(raft_server_t* me_, int msec_since_last_period)
raft_update_quorum_meta(me_, quorum_id); raft_update_quorum_meta(me_, quorum_id);
} }
} }
else if ((me->election_timeout_rand <= me->timeout_elapsed || me->timeout_now) && else if ((me->election_timeout_rand <= me->timeout_elapsed || me->timeout_now))
/* Don't become the leader when building snapshots or bad things will
* happen when we get a client request */
!raft_snapshot_is_in_progress(me_))
{ {
int e = raft_election_start(me_); int e = raft_election_start(me_);
if (0 != e) if (0 != e)
......
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