From patchwork Fri Jul 9 13:10:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1503142 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=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jO/MynPE; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLtnz4bWZz9sRN for ; Fri, 9 Jul 2021 23:11:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 27120402B9; Fri, 9 Jul 2021 13:10:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ig-HXBHbH1he; Fri, 9 Jul 2021 13:10:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 1CD2B40248; Fri, 9 Jul 2021 13:10:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E065CC0010; Fri, 9 Jul 2021 13:10:55 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2DD71C000E for ; Fri, 9 Jul 2021 13:10:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 176C04239D for ; Fri, 9 Jul 2021 13:10:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZuO0TUhS4RSl for ; Fri, 9 Jul 2021 13:10:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by smtp4.osuosl.org (Postfix) with ESMTPS id EAF854239C for ; Fri, 9 Jul 2021 13:10:49 +0000 (UTC) Received: by mail-lj1-x22a.google.com with SMTP id u25so7935526ljj.11 for ; Fri, 09 Jul 2021 06:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L8cXCbyKfcMBycgKTEB3uyBavFRsmvhmFXOCTH+/akc=; b=jO/MynPE72yBCH/KR/CqDzXHI+0P1piEKMi7PSTyvS98HWBtaduY6MoSFAdbDjO1x1 maUiB0JhbWg4H41aUIIvPDHQZOHMpYYtWyjCAP9oNprzaBqrod0I6sm6i2mNGdVVjqn6 0w3r1H9dp/EssPNh46YxHIjKKzASzx8Kma7R4TUjrMjllVppZJvgVKnD2o3BYth2FENt BzAg+Stn47WtkbOKH+ZXFUGQkYwzObAMob7f4dXO7cDt7eOevdbRDqCrNEACTV/X82zc meT71bah6hm0P8IIVeHG7xfrJwRBtWLHIH70ik+zN4fvRp3kks7aJV2BwclolxK/WHG/ M3xA== 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:mime-version :content-transfer-encoding; bh=L8cXCbyKfcMBycgKTEB3uyBavFRsmvhmFXOCTH+/akc=; b=p24y9BgLIYJQJ/lxZ5WEKflpIDlTnj0uTGzMH3DnlaUytr0onBY2ixq1YmJ/++DeS5 aHMekR0ywWbsDD/52up8M5NgmE5Hw1mePomuwgyL+NtergdxyDOVBnB9x6LFBYFIpCjX oZb2fYcCUsmldMLmLvGQiSkmHw7ufn257IeNimfMlAf7gXUYSroIz16jVcV6TVGo6rZl di5D2SXh1FdzeoPlBkyNhipbDSHtUYQZDmuyOSsf7T8pzHLoBZO0Q3QIvfSmI02POQva fOQReExWX5s2cWdjiyVO8kAu3B55r41nxGKwiAAy8ljTRNRDaEevBgqry+vglCheF0dX fl1Q== X-Gm-Message-State: AOAM533BXAiuOu5tXPsykxbBfAtmXaDzeTkLBdXKe5bvypoI47Ld26VB VIB0GirQyf0MHhcKHcYrE5E6f/BwEehebQ== X-Google-Smtp-Source: ABdhPJxCvBB+REYEaToMRfY4ZLngdl3pavvlqV+jYY1NAvLD+MlT62ZlprlsJuGt6G5OErWv/qhlMg== X-Received: by 2002:a2e:a785:: with SMTP id c5mr29491781ljf.490.1625836247516; Fri, 09 Jul 2021 06:10:47 -0700 (PDT) Received: from localhost.localdomain ([185.12.31.132]) by smtp.gmail.com with ESMTPSA id u26sm566103lju.53.2021.07.09.06.10.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jul 2021 06:10:47 -0700 (PDT) From: Vladislav Odintsov To: dev@openvswitch.org Date: Fri, 9 Jul 2021 16:10:43 +0300 Message-Id: <20210709131043.51831-1-odivlad@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Cc: Dumitru Ceara Subject: [ovs-dev] [PATCH ovn branch-20.09] ovn-controller: Monitor chassis_private by chassis name. 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" From: Dumitru Ceara Remove the use of sbrec_chassis_is_new() for uncommitted records. This is not the way IDL *_is_new() functions are supposed to be used. Note: With this change if the system-id changes there will be a transient error in ovn-controller due to ovn-controller trying to insert a new chassis_private record. This is due to the fact that the view of the chassis_private table changes and only chassis_private records matching the new chassis name are sent to ovn-controller. This gets corrected though in the next iteration of the ovn-controller processing loop. Suggested-by: Han Zhou Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-October/376339.html Fixes: dce1af31b550 ("chassis: Fix chassis_private record updates when the system-id changes.") Signed-off-by: Dumitru Ceara Acked-by: Mark Gray Signed-off-by: Han Zhou (cherry picked from commit 1f915da95dc725131b7df094d494af9fda88ea92) Acked-by: Vladislav Odintsov Signed-off-by: Vladislav Odintsov --- controller/ovn-controller.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 3665c7b4e..b154a8486 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -181,7 +181,7 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl, * chassis */ sbrec_port_binding_add_clause_type(&pb, OVSDB_F_EQ, "chassisredirect"); sbrec_port_binding_add_clause_type(&pb, OVSDB_F_EQ, "external"); - if (chassis && !sbrec_chassis_is_new(chassis)) { + if (chassis) { /* This should be mostly redundant with the other clauses for port * bindings, but it allows us to catch any ports that are assigned to * us but should not be. That way, we can clear their chassis @@ -205,8 +205,8 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl, &chassis->header_.uuid); /* Monitors Chassis_Private record for current chassis only. */ - sbrec_chassis_private_add_clause_chassis(&chprv, OVSDB_F_EQ, - &chassis->header_.uuid); + sbrec_chassis_private_add_clause_name(&chprv, OVSDB_F_EQ, + chassis->name); } else { /* During initialization, we monitor all records in Chassis_Private so * that we don't try to recreate existing ones. */