Commit 782191d
committed
ovsdb: raft: Actually suppress the disruptive server.
Section 4.2.3 "Disruptive Servers" says:
...if a server receives a RequestVote request within the minimum
election timeout of hearing from a current leader, it does not
update its term or grant its vote. It can either drop the request,
reply with a vote denial, or delay the request; the result is
essentially the same...
However, while logic in the code does make it skip the term update, it
still proceeds to reply with the vote, because when the suppression
check returns true, we'll not enter the 'if' block and will proceed to
the RPC 'switch' instead.
It will reply with a vote for the candidate it already voted for on
this term for an actual vote and it will vote for the requester on
the pre-vote. This effectively bypasses the pre-vote scheme as the
disruptive server will win the pre-vote and proceed to the regular
election. And while the disruptor will not win the actual vote, it
has a term +1 and will reply with a "stale term" to the next append
request, forcing the current leader to step down.
Fix that by actually not responding to the disruptive vote requests,
i.e. by taking the "drop the request" route.
The test is updated with a new failure model where vote requests are
actually getting sent out. There is a value in testing the full RPC
stop as well, so keeping the current checks as they are.
Also removing the duplicate term check in the vote reply handler,
as it is now clear that the term check will not be skipped.
Fixes: 1b1d2e6 ("ovsdb: Introduce experimental support for clustered databases.")
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>1 parent 03cd347 commit 782191d
2 files changed
+25
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3935 | 3935 | | |
3936 | 3936 | | |
3937 | 3937 | | |
3938 | | - | |
3939 | | - | |
3940 | | - | |
3941 | | - | |
3942 | 3938 | | |
3943 | 3939 | | |
3944 | 3940 | | |
| |||
4700 | 4696 | | |
4701 | 4697 | | |
4702 | 4698 | | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
4703 | 4703 | | |
4704 | | - | |
4705 | | - | |
4706 | | - | |
| 4704 | + | |
4707 | 4705 | | |
4708 | 4706 | | |
4709 | 4707 | | |
| |||
5227 | 5225 | | |
5228 | 5226 | | |
5229 | 5227 | | |
| 5228 | + | |
5230 | 5229 | | |
5231 | 5230 | | |
5232 | 5231 | | |
| |||
5235 | 5234 | | |
5236 | 5235 | | |
5237 | 5236 | | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
5238 | 5244 | | |
5239 | 5245 | | |
5240 | 5246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1008 | 1020 | | |
1009 | 1021 | | |
1010 | 1022 | | |
| |||
0 commit comments