From patchwork Tue Jun 20 09:19:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1797062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.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=g4FZT4MS; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qlh1Z6yn7z20WT for ; Tue, 20 Jun 2023 19:20:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DF1798218E; Tue, 20 Jun 2023 09:20:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DF1798218E Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g4FZT4MS X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JHhBOt41QNpD; Tue, 20 Jun 2023 09:20:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id E1DAA82137; Tue, 20 Jun 2023 09:20:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E1DAA82137 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B60E4C0037; Tue, 20 Jun 2023 09:20:14 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 06973C0029 for ; Tue, 20 Jun 2023 09:20:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 77D99418A1 for ; Tue, 20 Jun 2023 09:20:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 77D99418A1 Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g4FZT4MS X-Virus-Scanned: amavisd-new at osuosl.org 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 AeZZ6npkugbI for ; Tue, 20 Jun 2023 09:20:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B63D24038C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id B63D24038C for ; Tue, 20 Jun 2023 09:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687252805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B+r7zOoEVYUtr7znHuS7HeWYZPvfORQ9OGQTJskvGQE=; b=g4FZT4MSnOymMllM4Vl/OeAQjtu/lrlQjMh+19h5Zkglm8hydwUHY5q1PcDto0+PKRxZ+8 wEjhBb8pxqWn9QwLmgk/I7BUtNbYfjMBgI3/THfSuom9lmWUWVWs9yO+zKMPEnq+yeXjMt I42BP0mrExvr4+6ObpyZHum+e2kJj3A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-U0OejBYCPrm6EyLoBUK9Ng-1; Tue, 20 Jun 2023 05:20:00 -0400 X-MC-Unique: U0OejBYCPrm6EyLoBUK9Ng-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E8F6185A793 for ; Tue, 20 Jun 2023 09:20:00 +0000 (UTC) Received: from dceara.remote.csb (unknown [10.39.194.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id E19FB4087C6A for ; Tue, 20 Jun 2023 09:19:59 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Tue, 20 Jun 2023 11:19:57 +0200 Message-Id: <168725279565.85238.11815861730765741839.stgit@dceara.remote.csb> In-Reply-To: <168725277199.85238.17625527947702459868.stgit@dceara.remote.csb> References: <168725277199.85238.17625527947702459868.stgit@dceara.remote.csb> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 2/2] expr.c: Remove backwards compatibility lookup in parse_port_group(). 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" It's been more than 2.5 years since the first release in which northd started storing SB.Port_Group.name as after bff01d49d6f2 ("Split SB Port_Group per datapath."). There's a safe upgrade path via the LTS release for deployments that still run older ovn-controller versions. Signed-off-by: Dumitru Ceara --- TODO.rst | 8 -------- lib/expr.c | 12 ------------ 2 files changed, 20 deletions(-) diff --git a/TODO.rst b/TODO.rst index 9e4db12e12..dff163e70b 100644 --- a/TODO.rst +++ b/TODO.rst @@ -86,14 +86,6 @@ OVN To-do List * Packaging for Debian. -* ovn-controller: Remove backwards compatibility for Southbound DB Port_Group - names in expr.c a few releases after the 20.09 version. Right now - ovn-controller maintains backwards compatibility when connecting to a - SB database that doesn't store Port_Group.name as - . This causes an additional - hashtable lookup in parse_port_group() which can be avoided when we are sure - that the Southbound DB uses the new format. - * ovn-northd-ddlog: Calls to warn() and err() from DDlog code would be better refactored to use the Warning[] relation (and introduce an Error[] relation once we want to issue some errors that way). This diff --git a/lib/expr.c b/lib/expr.c index 9659b9b63d..f5d2032334 100644 --- a/lib/expr.c +++ b/lib/expr.c @@ -845,18 +845,6 @@ parse_port_group(struct expr_context *ctx, struct expr_constant_set *cs, if (ctx->port_groups) { port_group = shash_find_data(ctx->port_groups, ds_cstr(&sb_name)); - if (!port_group) { - /* For backwards compatibility (e.g., ovn-controller was - * upgraded but ovn-northd not yet), perform an additional - * lookup because the NB Port_Group.name might have been - * stored as is in the SB Port_Group.name field. - */ - port_group = shash_find_data(ctx->port_groups, - ctx->lexer->token.s); - if (ctx->port_groups_ref) { - sset_add(ctx->port_groups_ref, ctx->lexer->token.s); - } - } } ds_destroy(&sb_name);