From patchwork Tue Feb 23 13:16:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1443478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DlKMh5k0tz9sRN for ; Wed, 24 Feb 2021 00:17:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6A91D86F12; Tue, 23 Feb 2021 13:17:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jd1guw986AZW; Tue, 23 Feb 2021 13:17:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id E313685ECB; Tue, 23 Feb 2021 13:17:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7699C000A; Tue, 23 Feb 2021 13:17:02 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id AED81C0001 for ; Tue, 23 Feb 2021 13:17:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9D0A48558A for ; Tue, 23 Feb 2021 13:17:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wcac2Okg5lvs for ; Tue, 23 Feb 2021 13:16:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 99A9485585 for ; Tue, 23 Feb 2021 13:16:59 +0000 (UTC) Received: from im-t490s.redhat.com (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 18922200004; Tue, 23 Feb 2021 13:16:54 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Tue, 23 Feb 2021 14:16:51 +0100 Message-Id: <20210223131651.53640-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Ilya Maximets , Dumitru Ceara Subject: [ovs-dev] [PATCH] raft: Report disconnected in cluster/status if candidate retries election. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 Acked-by: Han Zhou --- 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:");