From patchwork Mon Dec 14 01:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: XiaoXiong Ding X-Patchwork-Id: 1415726 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CvPC81nssz9sSn for ; Mon, 14 Dec 2020 12:37:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6452C86BDE; Mon, 14 Dec 2020 01:37:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XMdxOfPTRfW2; Mon, 14 Dec 2020 01:37:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5F47086978; Mon, 14 Dec 2020 01:37:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 40196C0893; Mon, 14 Dec 2020 01:37:16 +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 A322CC013B for ; Mon, 14 Dec 2020 01:37:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 83A40203B2 for ; Mon, 14 Dec 2020 01:37:14 +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 PPxqqzKQvXKS for ; Mon, 14 Dec 2020 01:37:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by silver.osuosl.org (Postfix) with ESMTPS id C21BD203A6 for ; Mon, 14 Dec 2020 01:37:12 +0000 (UTC) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CvPBH60htzhrrH; Mon, 14 Dec 2020 09:36:39 +0800 (CST) Received: from DESKTOP-PDTUPEE.china.huawei.com (10.174.243.188) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Mon, 14 Dec 2020 09:36:59 +0800 From: XiaoXiong Ding To: Date: Mon, 14 Dec 2020 09:36:54 +0800 Message-ID: <20201214013654.214108-1-dingxiaoxiong@huawei.com> X-Mailer: git-send-email 2.14.1.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.243.188] X-CFilter-Loop: Reflected Cc: guohongzhi1@huawei.com, XiaoXiong Ding , fbl@sysclose.org, blp@nicira.com, alexw@nicira.com, chenchanghu@huawei.com Subject: [ovs-dev] [PATCH] bridge:The retry function does not work. 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" The value of status_txn_try_again is set to true after bridge_reconfigure. It is expected that the system will try again later. However, run_status_update will Check status_txn. if status_txn is not null, the logic for re-applying for the transition is skipped and submit the status_txn again. If this operation is successful, set status_txn_try_again to false. As a result, the status_txn_try_again flag do not work and the results in bridge_reconfigure cannot be synchronized to the database, and the data in the database remains unchanged. The Solution is If status_txn_try_again is set to true, submit the previous status_txn firstly. Give up even it is success or not. This ensures that the retry logic can always be executed. Fixes: 15c9fbd8f28f ("bridge: Make ovs-vswitchd run again if status_txn commit fails.") Signed-off-by: XiaoXiong Ding --- vswitchd/bridge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 2976771ae..c2c17a10d 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2854,9 +2854,12 @@ stats_update_wait(void) static void run_status_update(void) { - if (!status_txn) { + if (!status_txn || status_txn_try_again) { uint64_t seq; - + if (status_txn) { + ovsdb_idl_txn_commit(status_txn); + ovsdb_idl_txn_destroy(status_txn); + } /* Rate limit the update. Do not start a new update if the * previous one is not done. */ seq = seq_read(connectivity_seq_get());