[ovs-dev] [PATCH] raft: Report disconnected in cluster/status if candidate retries election.

Ilya Maximets i.maximets at ovn.org
Tue Feb 23 13:16:51 UTC 2021


If election times out for a server in 'candidate' role it sets
'candidate_retrying' flag that notifies that storage is disconnected
and client should re-connect.  However, cluster/status command
reports 'Status: cluster member' and that is misleading.
Reporting "disconnected from the cluster (election timeout)" instead.

Fixes: 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases.")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 ovsdb/raft.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovsdb/raft.c b/ovsdb/raft.c
index 0fb1420fb..192f7f0a9 100644
--- a/ovsdb/raft.c
+++ b/ovsdb/raft.c
@@ -4498,6 +4498,8 @@ raft_unixctl_status(struct unixctl_conn *conn,
                   : raft->leaving ? "leaving cluster"
                   : raft->left ? "left cluster"
                   : raft->failed ? "failed"
+                  : raft->candidate_retrying
+                      ? "disconnected from the cluster (election timeout)"
                   : "cluster member");
     if (raft->joining) {
         ds_put_format(&s, "Remotes for joining:");
-- 
2.26.2



More information about the dev mailing list