From patchwork Mon Mar 9 10:49:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1251443 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48bZlC1sGKz9s3x for ; Mon, 9 Mar 2020 21:51:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 25176863E0; Mon, 9 Mar 2020 10:51:01 +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 4LcHlr5XMxcm; Mon, 9 Mar 2020 10:50:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8AD2686472; Mon, 9 Mar 2020 10:50:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6CF20C18D3; Mon, 9 Mar 2020 10:50:42 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2D14BC0177 for ; Mon, 9 Mar 2020 10:50:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 115E8250BF for ; Mon, 9 Mar 2020 10:50:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3Zz4bhtVkq0B for ; Mon, 9 Mar 2020 10:50:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by silver.osuosl.org (Postfix) with ESMTP id 054EB250B5 for ; Mon, 9 Mar 2020 10:50:32 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45e661f55727-4c3e3; Mon, 09 Mar 2020 18:49:57 +0800 (CST) X-RM-TRANSID: 2ee45e661f55727-4c3e3 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from yun.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee25e661f54168-a8838; Mon, 09 Mar 2020 18:49:57 +0800 (CST) X-RM-TRANSID: 2ee25e661f54168-a8838 From: Tao YunXiang To: dev@openvswitch.org Date: Mon, 9 Mar 2020 18:49:39 +0800 Message-Id: <20200309104939.4971-1-taoyunxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <8> References: <8> Cc: Liu Chang , Tao YunXiang Subject: [ovs-dev] [PATCH] ovn-ctl: Add "--no-leader-only" while cluster db init 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" For cluster mode, only the first server(which is the leader) in a cluster should do init. But, sometimes, the role of the first server would transfer leadership, so we should add "--no-leader-only" option in case the ovn-northd stucked. Author: Tao YunXiang Co-authored-by: Liu Chang Signed-off-by: Tao YunXiang Signed-off-by: Liu Chang Acked-by: Numan Siddique --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 2a337ae27..71bdbc076 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -293,7 +293,7 @@ $cluster_remote_port # Initialize the database if it's running standalone, # active-passive, or is the first server in a cluster. if test -z "$cluster_remote_addr"; then - $(echo ovn-${db}ctl | tr _ -) init + $(echo ovn-${db}ctl | tr _ -) --no-leader-only init fi if test $mode = cluster; then