forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovsdb: raft: Support pre-vote mechanism to deal with disruptive server.
When a server becomes unstable due to system overloading or intermittent partitioning, it may miss some heartbeats and then starts election with a new term, which would disrupt the otherwise healthy cluster formed by the rest of the healthy nodes. Such situation may exist for a long time until the "flapping" server is shutdown or recovered completely, which can severely impact the availability of the cluster. The pre-vote mechanism introduced in the raft paper section 9.6 can prevent such problems. This patch implements the pre-vote mechanism. Note: during the upgrade, since the old version doesn't recognize the new optional field in the vote rpc (and the ovsdb_parse_finish validates that all fields in the jsonrpc are parsed), an error log may be noticed on old nodes if an upgraded node happens to become candidate first and vote for itself, and the vote request will be discarded. If this happens before enough nodes complete the upgrade, the vote from the upgraded node may not reach the quorum. This results in re-election, and any old nodes should be able to vote and get elected as leader. So, in unlucky cases there can be more leader elections happening during the upgrade. Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Han Zhou <[email protected]> Signed-off-by: Ilya Maximets <[email protected]>
- Loading branch information
Showing
5 changed files
with
136 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters