]> git.proxmox.com Git - mirror_ovs.git/commit
raft.c: Stale leader should disconnect from cluster.
authorHan Zhou <hzhou8@ebay.com>
Mon, 19 Aug 2019 16:29:58 +0000 (09:29 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 21 Aug 2019 18:30:05 +0000 (11:30 -0700)
commit89771c1e65304b815ec01ec0f11affac01d62169
tree39bcb0c2f7d589a6f6b003958446d563fc970799
parentca367fa5f8bb40a5d0b695df9ca25c26974b792f
raft.c: Stale leader should disconnect from cluster.

As mentioned in RAFT paper, section 6.2:

Leaders: A server might be in the leader state, but if it isn’t the current
leader, it could be needlessly delaying client requests. For example, suppose a
leader is partitioned from the rest of the cluster, but it can still
communicate with a particular client. Without additional mechanism, it could
delay a request from that client forever, being unable to replicate a log entry
to any other servers. Meanwhile, there might be another leader of a newer term
that is able to communicate with a majority of the cluster and would be able to
commit the client’s request. Thus, a leader in Raft steps down if an election
timeout elapses without a successful round of heartbeats to a majority of its
cluster; this allows clients to retry their requests with another server.

Reported-by: Aliasgar Ginwala <aginwala@ebay.com>
Tested-by: Aliasgar Ginwala <aginwala@ebay.com>
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovsdb/raft-private.h
ovsdb/raft.c
tests/ovsdb-cluster.at