From patchwork Thu Jan 11 08:48:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kalcok X-Patchwork-Id: 1885418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=tpgCNrMj; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T9dd448Wcz1yPt for ; Thu, 11 Jan 2024 19:49:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B8F5C81EAA; Thu, 11 Jan 2024 08:49:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B8F5C81EAA Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=tpgCNrMj 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 vB0TBPjiIONu; Thu, 11 Jan 2024 08:49:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 14EE781E63; Thu, 11 Jan 2024 08:49:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 14EE781E63 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D4F91C0072; Thu, 11 Jan 2024 08:49:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7BE25C0037 for ; Thu, 11 Jan 2024 08:49:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3F48940354 for ; Thu, 11 Jan 2024 08:49:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3F48940354 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=tpgCNrMj 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 UDxBH90WIA5d for ; Thu, 11 Jan 2024 08:49:01 +0000 (UTC) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4C6CD40323 for ; Thu, 11 Jan 2024 08:49:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4C6CD40323 Received: from omen-desktop.. (178-143-45-10.static.orange.sk [178.143.45.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 9D0B53FB40; Thu, 11 Jan 2024 08:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704962938; bh=3Q+67GNpb2Kwk4WufJXx6blUFSfwHmUIN5WVJFrZi3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tpgCNrMjPJ9ckG6wMJukmzOUsHJ7YmT8IGnoePpo/yWLCqXw2AmAj86Aw/KxIanoe vhpWfbdCvdnl5Xsq8WD2cSpmT7U54HAyYAO5fr7s6zv4vlyRY4xtFriwyUDEYod1DX YmEbEG/0g7To3vPS5GdaAGVMR06Ttn+8tWxzC6Xzi26NM+wI9E41ZHjitEbNjdOXg+ ilnkr1NKtRU0he9obL5s8AON6pYu3WuwvjRVKkrLxx2jTRN39GiIHkgMyo3t5BXh1a JmBd9oKcXQhRrA0I3zEDpn4tbqojZ8xI/SLw6/JarsP6y4R83sJK17ZUbGpYwncjAp 7g/nysnRwBO/A== From: Martin Kalcok To: dev@openvswitch.org Date: Thu, 11 Jan 2024 09:48:49 +0100 Message-Id: <20240111084850.9265-1-martin.kalcok@canonical.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v3] ovn-ctl: Add option to skip schema conversion 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" ovn-ctl script currently automatically attempts to perform clustered database schema upgrade when starting OVN SB or NB clustered database. To provide more control over this process a `--db-cluster-schema-upgrade` option is added. Default value for this option is `yes`, to preserve current default behavior. To start database without performing schema conversion, user can provide either `--db-cluster-schema-upgrade=no` option or `--no-db-cluster-schema-upgrade` flag to the ovn-ctl script. Signed-off-by: Martin Kalcok Reviewed-by: Frode Nordahl --- utilities/ovn-ctl | 7 ++++++- utilities/ovn-ctl.8.xml | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 876565c80..50d588358 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -184,6 +184,7 @@ start_ovsdb__() { local ovn_db_ssl_cacert local ovn_db_election_timer local relay_mode + local cluster_db_upgrade eval db_pid_file=\$DB_${DB}_PIDFILE eval cluster_local_addr=\$DB_${DB}_CLUSTER_LOCAL_ADDR eval cluster_local_port=\$DB_${DB}_CLUSTER_LOCAL_PORT @@ -212,6 +213,7 @@ start_ovsdb__() { eval ovn_db_election_timer=\$DB_${DB}_ELECTION_TIMER eval relay_mode=\$RELAY_MODE eval relay_remote=\$DB_${DB}_REMOTE + eval cluster_db_upgrade=\$DB_CLUSTER_SCHEMA_UPGRADE ovn_install_dir "$OVN_RUNDIR" ovn_install_dir "$ovn_logdir" @@ -347,7 +349,7 @@ $cluster_remote_port $(echo ovn-${db}ctl | tr _ -) --no-leader-only --db="unix:$sock" init fi - if test $mode = cluster; then + if test $mode = cluster && test X"$cluster_db_upgrade" = Xyes; then upgrade_cluster "$schema" "unix:$sock" fi @@ -898,6 +900,8 @@ set_defaults () { OVN_SB_RELAY_DB_SSL_CERT="" OVN_SB_RELAY_DB_SSL_CA_CERT="" DB_SB_RELAY_USE_REMOTE_IN_DB="yes" + + DB_CLUSTER_SCHEMA_UPGRADE="yes" } set_option () { @@ -1148,6 +1152,7 @@ File location options: --ovn-sb-relay-db-ssl-key=KEY OVN_Southbound DB relay SSL private key file --ovn-sb-relay-db-ssl-cert=CERT OVN_Southbound DB relay SSL certificate file --ovn-sb-relay-db-ssl-ca-cert=CERT OVN OVN_Southbound DB relay SSL CA certificate file + --db-cluster-schema-upgrade=yes|no (default: $DB_CLUSTER_SCHEMA_UPGRADE) Default directories with "configure" option and environment variable override: logs: /usr/local/var/log/ovn (--with-logdir, OVN_LOGDIR) diff --git a/utilities/ovn-ctl.8.xml b/utilities/ovn-ctl.8.xml index 01f4aa26b..3bab055e4 100644 --- a/utilities/ovn-ctl.8.xml +++ b/utilities/ovn-ctl.8.xml @@ -156,6 +156,7 @@

--db-ic-sb-cluster-remote-addr=IP ADDRESS

--db-ic-sb-cluster-remote-port=PORT NUMBER

--db-ic-sb-cluster-remote-proto=PROTO (tcp/ssl)

+

--db-cluster-schema-upgrade=yes|no

Probe interval options

--db-nb-probe-interval-to-active=Time in milliseconds

@@ -324,4 +325,24 @@ start_northd

+

Avoiding automatic clustered OVN database schema upgrade

+

+ If you desire more control over clustered DB schema upgrade, you can + opt-out of automatic on-start upgrade attempts with + --no-db-cluster-schema-upgrade. +

+

Start OVN NB and SB clustered databases on host with IP x.x.x.x without schema upgrade

+

+ + # ovn-ctl start_nb_ovsdb --db-nb-cluster-local-addr=x.x.x.x --no-db-cluster-schema-upgrade + # ovn-ctl start_sb_ovsdb --db-sb-cluster-local-addr=x.x.x.x --no-db-cluster-schema-upgrade + +

+

Trigger clustered DB schema upgrade manually

+

+ + # ovsdb-client convert unix:/var/run/ovn/ovnnb_db.sock /usr/local/share/ovn/ovn-nb.ovsschema + # ovsdb-client convert unix:/var/run/ovn/ovnsb_db.sock /usr/local/share/ovn/ovn-sb.ovsschema + +