]> git.proxmox.com Git - mirror_ovs.git/commit
raft.c: Set candidate_retrying if no leader elected since last election.
authorHan Zhou <hzhou8@ebay.com>
Mon, 19 Aug 2019 16:29:59 +0000 (09:29 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 21 Aug 2019 18:30:07 +0000 (11:30 -0700)
commit923f01cad678228224ae4fe86466e2f61ab2c9d0
treeb2fa82679cd8d695ac0bf3bb54cf75db84bc5c08
parent89771c1e65304b815ec01ec0f11affac01d62169
raft.c: Set candidate_retrying if no leader elected since last election.

candiate_retrying is used to determine if the current node is disconnected
from the cluster when the node is in candiate role. However, a node
can flap between candidate and follower role before a leader is elected
when majority of the cluster is down, so is_connected() will flap, too, which
confuses clients.

This patch avoids the flapping with the help of a new member had_leader,
so that if no leader was elected since last election, we know we are
still retrying, and keep as disconnected from the cluster.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovsdb/raft.c
tests/ovsdb-cluster.at