From patchwork Tue Mar 17 03:16:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1256016 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.136; helo=silver.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48hJHZ3FCtz9sPR for ; Tue, 17 Mar 2020 14:16:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D9EE822731; Tue, 17 Mar 2020 03:16:51 +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 DND06qLTOPSo; Tue, 17 Mar 2020 03:16:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 34B56203A3; Tue, 17 Mar 2020 03:16:49 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 24A1CC1D7C; Tue, 17 Mar 2020 03:16:49 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 508B1C013E for ; Tue, 17 Mar 2020 03:16:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3A7DC88026 for ; Tue, 17 Mar 2020 03:16:48 +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 elxKvd60HJim for ; Tue, 17 Mar 2020 03:16:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by hemlock.osuosl.org (Postfix) with ESMTP id 9654187EA1 for ; Tue, 17 Mar 2020 03:16:45 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.15]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95e704100efc-eebb9; Tue, 17 Mar 2020 11:16:16 +0800 (CST) X-RM-TRANSID: 2ee95e704100efc-eebb9 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from yun.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee85e7040fe40c-02fe4; Tue, 17 Mar 2020 11:16:15 +0800 (CST) X-RM-TRANSID: 2ee85e7040fe40c-02fe4 From: Tao YunXiang To: dev@openvswitch.org Date: Tue, 17 Mar 2020 11:16:10 +0800 Message-Id: <20200317031610.5621-1-taoyunxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <6> References: <6> Cc: Liu Chang , Rong Yin , Tao YunXiang Subject: [ovs-dev] [PATCH v2 OVN] ovn-ctl: Fix stucked while do 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 in case the ovn-northd stucked. v1: ovn-ctl: Add "--no-leader-only" while cluster db init Author: Tao YunXiang Co-authored-by: Liu Chang Co-authored-by: Rong Yin Signed-off-by: Tao YunXiang Signed-off-by: Liu Chang Signed-off-by: Rong Yin --- utilities/ovn-ctl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 2a337ae27..8afe68a0a 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -290,10 +290,9 @@ $cluster_remote_port "$@" "$file" - # Initialize the database if it's running standalone, - # active-passive, or is the first server in a cluster. + # Initialize the database if it's NOT joining 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