NuRaft
NuRaft copied to clipboard
Wrong election timer config may cause never-ending leader election
Let's say we have 3 servers: S1, S2, and S3. Suppose that we don't have leader now. S1 and S2's priorities are higher than S3.
However, let's assume that we have wrong config; election timeout for S1 and S2 is much longer than S3. Below is what will happen in such case:
- After some timeouts, S3's target priority is properly lowered.
- S3 will initiate pre-vote.
- S1 and S2 will accept the pre-vote.
- S3 will initiate actual vote.
- Since S1 and S2 haven't encountered election timeout, they reject the vote due to their target priority.
- S1 and S2 update their term; so reset their election timer.
Problem: S1 and S2 will never reach the election timeout, so that never reduce their target priority.
Fix: https://github.com/eBay/NuRaft/pull/33