From patchwork Tue Oct 20 09:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1384738 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=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F7aY6x3A; dkim-atps=neutral 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 4CFp375f2Nz9ryj for ; Tue, 20 Oct 2020 20:18:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CD7942E19D; Tue, 20 Oct 2020 09:18:53 +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 qWl869BwAhEz; Tue, 20 Oct 2020 09:18:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 0A39A20005; Tue, 20 Oct 2020 09:18:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E1557C088B; Tue, 20 Oct 2020 09:18:51 +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 DD25FC0051 for ; Tue, 20 Oct 2020 09:18:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D3B3D2002A for ; Tue, 20 Oct 2020 09:18:49 +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 A3eDf07D0UML for ; Tue, 20 Oct 2020 09:18:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by silver.osuosl.org (Postfix) with ESMTPS id EDA8C20005 for ; Tue, 20 Oct 2020 09:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603185527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type; bh=asxbz2LH5N6y7n2tEIs/hEaV/slgjheuw9KaWQQl+5U=; b=F7aY6x3Al4mQbUo+Z4YDHC8kra1v8o513UWb5kaofHqcM7FREH0Uy5V3AnXtP2JpE/lAFb UOOAv/Wgy6B1wWXSVV5uEMNYpoUGNHpr7UEZ29L4VrhHruwpsmXf40sXrApKjJ9lr1O9x3 KPlscVoHFxxMXn2y7wRO7Ma2A8LmWVc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-scJQQCumPpStKAHQtaSW7w-1; Tue, 20 Oct 2020 05:18:44 -0400 X-MC-Unique: scJQQCumPpStKAHQtaSW7w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8AA7879515; Tue, 20 Oct 2020 09:18:43 +0000 (UTC) Received: from dceara.remote.csb (ovpn-114-167.ams2.redhat.com [10.36.114.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2C851A92D; Tue, 20 Oct 2020 09:18:39 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Tue, 20 Oct 2020 11:18:32 +0200 Message-Id: <1603185512-8070-1-git-send-email-dceara@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: hzhou@ovn.org Subject: [ovs-dev] [PATCH ovn] 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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 --- 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 066e31f..a06cae3 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. */