From patchwork Thu Dec 16 03:26:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1568882 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JDyGc1gMqz9s1l for ; Thu, 16 Dec 2021 14:27:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0C8C740AE4; Thu, 16 Dec 2021 03:27:18 +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 GRYurfbjHDrf; Thu, 16 Dec 2021 03:27:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id BF67340AE1; Thu, 16 Dec 2021 03:27:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6C8A6C001E; Thu, 16 Dec 2021 03:27:15 +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 5DD21C0012 for ; Thu, 16 Dec 2021 03:27:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9DA0840AD1 for ; Thu, 16 Dec 2021 03:27:04 +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 2TqRaXSNzAcK for ; Thu, 16 Dec 2021 03:27:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp2.osuosl.org (Postfix) with ESMTPS id 227AC40AE1 for ; Thu, 16 Dec 2021 03:27:02 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id DBBA2FF805; Thu, 16 Dec 2021 03:27:00 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 15 Dec 2021 22:26:57 -0500 Message-Id: <20211216032657.2594118-1-numans@ovn.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <737ee4ccc9019970f1e7e4ac60b588e3750bb8f5.camel@redhat.com> References: <737ee4ccc9019970f1e7e4ac60b588e3750bb8f5.camel@redhat.com> MIME-Version: 1.0 Cc: Dan Williams Subject: [ovs-dev] [PATCH ovn 4/4] ovn-ctl: add RAFT election timer argument and pass to ovsdb-tool 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: Dan Williams Exits with an error if ovsdb-tool doesn't support --election-timer which was added in OVS 2.16 and later. Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1831778 Submitted-at: https://github.com/ovn-org/ovn/pull/109 Signed-off-by: Dan Williams --- utilities/ovn-ctl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 45ad197059..b789d57bed 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -165,6 +165,7 @@ start_ovsdb__() { local ovn_db_ssl_key local ovn_db_ssl_cert local ovn_db_ssl_cacert + local ovn_db_election_timer 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 @@ -190,6 +191,7 @@ start_ovsdb__() { eval ovn_db_ssl_key=\$OVN_${DB}_DB_SSL_KEY eval ovn_db_ssl_cert=\$OVN_${DB}_DB_SSL_CERT eval ovn_db_ssl_cacert=\$OVN_${DB}_DB_SSL_CA_CERT + eval ovn_db_election_timer=\$DB_${DB}_ELECTION_TIMER ovn_install_dir "$OVN_RUNDIR" ovn_install_dir "$ovn_logdir" @@ -212,6 +214,15 @@ $sync_from_port" > $active_conf_file fi if test $mode = cluster; then + # check for election timer arg support in ovsdb-tool + has_election_timer=$(ovsdb-tool --help | grep "\--election-timer") + if test -n "$ovn_db_election_timer" && \ + test -z "$has_election_timer"; then + # caller requested election timer but ovsdb-tool doesn't support it + log_failure_msg "ovsdb-tool does not support --election-timer" + exit + fi + local local=$cluster_local_proto:$cluster_local_addr:\ $cluster_local_port local remote=$cluster_remote_proto:$cluster_remote_addr:\ @@ -219,7 +230,7 @@ $cluster_remote_port if test -n "$cluster_remote_addr"; then join_cluster "$file" "$schema_name" "$local" "$remote" else - create_cluster "$file" "$schema" "$local" + create_cluster "$file" "$schema" "$local" "$ovn_db_election_timer" fi else upgrade_db "$file" "$schema" @@ -672,6 +683,7 @@ set_defaults () { DB_NB_SYNC_FROM_ADDR= DB_NB_SYNC_FROM_PORT=6641 DB_NB_PROBE_INTERVAL_TO_ACTIVE=60000 + DB_NB_ELECTION_TIMER= DB_SB_SOCK=$OVN_RUNDIR/ovnsb_db.sock DB_SB_PIDFILE=$OVN_RUNDIR/ovnsb_db.pid @@ -683,6 +695,7 @@ set_defaults () { DB_SB_SYNC_FROM_ADDR= DB_SB_SYNC_FROM_PORT=6642 DB_SB_PROBE_INTERVAL_TO_ACTIVE=60000 + DB_SB_ELECTION_TIMER= DB_IC_NB_SOCK=$OVN_RUNDIR/ovn_ic_nb_db.sock DB_IC_NB_PIDFILE=$OVN_RUNDIR/ovn_ic_nb_db.pid @@ -973,11 +986,13 @@ File location options: --db-nb-sync-from-proto=PROTO OVN Northbound active db transport (default: $DB_NB_SYNC_FROM_PROTO) --db-nb-create-insecure-remote=yes|no Create ptcp OVN Northbound remote (default: $DB_NB_CREATE_INSECURE_REMOTE) --db-nb-probe-interval-to-active Active probe interval from standby to active ovsdb-server remote (default: $DB_NB_PROBE_INTERVAL_TO_ACTIVE) + --db-nb-election-timer=MS OVN Northbound RAFT db election timer to use on db creation (in milliseconds) --db-sb-sync-from-addr=ADDR OVN Southbound active db tcp address (default: $DB_SB_SYNC_FROM_ADDR) --db-sb-sync-from-port=ADDR OVN Southbound active db tcp port (default: $DB_SB_SYNC_FROM_PORT) --db-sb-sync-from-proto=PROTO OVN Southbound active db transport (default: $DB_SB_SYNC_FROM_PROTO) --db-sb-create-insecure-remote=yes|no Create ptcp OVN Southbound remote (default: $DB_SB_CREATE_INSECURE_REMOTE) --db-sb-probe-interval-to-active Active probe interval from standby to active ovsdb-server remote (default: $DB_SB_PROBE_INTERVAL_TO_ACTIVE) + --db-sb-election-timer=MS OVN Southbound RAFT db election timer to use on db creation (in milliseconds) --db-nb-cluster-local-addr=ADDR OVN_Northbound cluster local address \ (default: $DB_NB_CLUSTER_LOCAL_ADDR) --db-nb-cluster-local-port=PORT OVN_Northbound cluster local tcp port \