From patchwork Wed Jan 16 21:45:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1026243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oSNc+ez4"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43g1qn4zx9z9sDr for ; Thu, 17 Jan 2019 09:20:37 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 685B91389; Wed, 16 Jan 2019 22:19:05 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 25FADEEA for ; Wed, 16 Jan 2019 21:45:12 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D036581F for ; Wed, 16 Jan 2019 21:45:11 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id w73so3687045pfk.10 for ; Wed, 16 Jan 2019 13:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=zRCF6U0zU2ewd1d2TbG5YQwbnmGzunTXgNV19S8ZCpE=; b=oSNc+ez4tDHk1aU75aQCCYZRjKT8ew2fAso3o3Skc+TzTcwo416OHIu9GYtD3FrAk4 UySMBGLxhVqwVYG3r8Cyui5MbHUub0K+BW+XQuzV+KzqhhEEHbXpUtkWVEhuNLkGV4vj 1/ppTOv0p8sam8SQMNMe+GDjLg1k//njfxRnmPo3oW+SAEJVMOnIcZpVwTL8C81dYpyN RF09K6NSfLrU9/x88CI1FEP80e1+t9ibD59orUKTm/eUxm4e1tm5VPggoeiJCAbtyzR2 P+9Hzcz6bHWZysbNceMAXqfBTibMl2OgMad5+9y0IIL+0+XnkXm+mi8aX/OhvVAX2Koi PfVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zRCF6U0zU2ewd1d2TbG5YQwbnmGzunTXgNV19S8ZCpE=; b=CANs7/8LaUuJ1Zgi2R5ANaPldGYf58TzHeCv001kc8u7RfwQewsDZ7hwagQsVmKrH3 DKWsLg+51BK9YuzHvKMULsSeYffu+iIHvJdM+xTZIDeEtV/3f1gZSaILR9Eyn2J8X7kj p6/deeXlgcQ+gL1EP6EmHM+p5Lx+CZWdnkteHtI3hHyRwjZfiLVruYGXxPgae2RZrFis Rn7csjg/BPGDxeZ8nTnLuLWhoIRw+9TKcc6g8huoNmYWKhVkU9IqIytSlrWtwIFzxuc7 bVEKFEssrKDct+1jWwf4acs5M8dACASsDGflCesaRYrbRepkI/dHHBQfT7DETMQj/+/p 7rMA== X-Gm-Message-State: AJcUukcH/ORIvt4NzY8MlubWlsJnMD9zV+2p6OACOKtdoaCxKT0PVG+T dzRaBSVX4KmazOxwyccC6Mrv8pZh X-Google-Smtp-Source: ALg8bN5GIexPsHM7pz0Ed8QYGkixjiUvwWuFtsj5vZMQe1054vjiUCFyfaXv0aaS64VmR9WL/ol7Ng== X-Received: by 2002:a62:109b:: with SMTP id 27mr11847017pfq.227.1547675111047; Wed, 16 Jan 2019 13:45:11 -0800 (PST) Received: from localhost.localdomain.localdomain ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id n68sm10596979pfb.62.2019.01.16.13.45.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:45:10 -0800 (PST) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Wed, 16 Jan 2019 13:45:10 -0800 Message-Id: <1547675110-107566-1-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] sandbox: Fix env for clustered OVN DBs. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Han Zhou When ovn clustered mode is specified, the environment veriables OVN_NB_DB/OVN_SB_DB are wrong. It should be something like unix:nb1,unix:nb2,unix:nb3 but it turns out to be unix:nb1,unix:nb1,unix:nb2. So when nb3 becomes leader, the connection will always fail. It is caused by using an undefined variable $n resulting in the unexpected result of `seq 2 $n`. This patch fixed it by using the correct variable $servers. Signed-off-by: Han Zhou --- tutorial/ovs-sandbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox index 7a5ab5f..601d038 100755 --- a/tutorial/ovs-sandbox +++ b/tutorial/ovs-sandbox @@ -468,7 +468,7 @@ The backup database file is sandbox/${db}2.db ovn_start_ovsdb_server $i done remote=unix:${db}1.ovsdb - for i in `seq 2 $n`; do + for i in `seq 2 $servers`; do remote=$remote,unix:$db$i.ovsdb done for i in $(seq $servers); do