From patchwork Thu Dec 16 03:25:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1568879 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::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4JDyFX5QKMz9s1l for ; Thu, 16 Dec 2021 14:26:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DCB2E60FC0; Thu, 16 Dec 2021 03:26:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DnSVl1RtQ468; Thu, 16 Dec 2021 03:26:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0B9A460C02; Thu, 16 Dec 2021 03:26:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AEEE6C001E; Thu, 16 Dec 2021 03:26:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B1F1DC0012 for ; Thu, 16 Dec 2021 03:26:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A7BBD831F5 for ; Thu, 16 Dec 2021 03:26:15 +0000 (UTC) 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 P88EtbBWcwoS for ; Thu, 16 Dec 2021 03:26:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.osuosl.org (Postfix) with ESMTPS id 235F7831E7 for ; Thu, 16 Dec 2021 03:26:13 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 9D3A8E0007; Thu, 16 Dec 2021 03:26:10 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 15 Dec 2021 22:25:52 -0500 Message-Id: <20211216032552.2592644-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 1/4] ovn-ctl: use user-provided control socket paths 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 Allows users to consistently override the default control socket paths and file names. Submitted-at: https://github.com/ovn-org/ovn/pull/109 Signed-off-by: Dan Williams --- utilities/ovn-ctl | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index b30eb209d9..e31469535f 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -46,11 +46,11 @@ pidfile_is_running () { } >/dev/null 2>&1 stop_nb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnnb_db $DB_NB_PID $OVN_RUNDIR/ovnnb_db.ctl + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnnb_db $DB_NB_PID $DB_NB_CTRL_SOCK } stop_sb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnsb_db $DB_SB_PID $OVN_RUNDIR/ovnsb_db.ctl + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnsb_db $DB_SB_PID $DB_SB_CTRL_SOCK } stop_ovsdb () { @@ -59,11 +59,11 @@ stop_ovsdb () { } stop_ic_nb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_nb_db $DB_IC_NB_PID $OVN_RUNDIR/ovn_ic_nb_db.ctl + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_nb_db $DB_IC_NB_PID $DB_IC_NB_CTRL_SOCK } stop_ic_sb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_sb_db $DB_IC_SB_PID $OVN_RUNDIR/ovn_ic_sb_db.ctl + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_sb_db $DB_IC_SB_PID $DB_IC_SB_CTRL_SOCK } stop_ic_ovsdb () { @@ -84,9 +84,9 @@ demote_xx_ovsdb () { fi if test -e $active_conf_file; then - ovn-appctl -t $OVN_RUNDIR/$ctl_file ovsdb-server/set-active-ovsdb-server `cat $active_conf_file` - ovn-appctl -t $OVN_RUNDIR/$ctl_file ovsdb-server/connect-active-ovsdb-server - ovn-appctl -t $OVN_RUNDIR/$ctl_file ovsdb-server/set-active-ovsdb-server-probe-interval $inactive_probe_to_active + ovn-appctl -t $ctl_file ovsdb-server/set-active-ovsdb-server `cat $active_conf_file` + ovn-appctl -t $ctl_file ovsdb-server/connect-active-ovsdb-server + ovn-appctl -t $ctl_file ovsdb-server/set-active-ovsdb-server-probe-interval $inactive_probe_to_active else echo >&2 "$0: active server details not set" exit 1 @@ -96,46 +96,46 @@ demote_xx_ovsdb () { demote_ovnnb() { demote_xx_ovsdb $DB_NB_SYNC_FROM_ADDR $DB_NB_SYNC_FROM_PROTO \ $DB_NB_SYNC_FROM_PORT $ovnnb_active_conf_file \ - $DB_NB_PROBE_INTERVAL_TO_ACTIVE ovnnb_db.ctl + $DB_NB_PROBE_INTERVAL_TO_ACTIVE $DB_NB_CTRL_SOCK } demote_ovnsb() { demote_xx_ovsdb $DB_SB_SYNC_FROM_ADDR $DB_SB_SYNC_FROM_PROTO \ $DB_SB_SYNC_FROM_PORT $ovnsb_active_conf_file \ - $DB_SB_PROBE_INTERVAL_TO_ACTIVE ovnsb_db.ctl + $DB_SB_PROBE_INTERVAL_TO_ACTIVE $DB_SB_CTRL_SOCK } demote_ic_nb() { demote_xx_ovsdb $DB_IC_NB_SYNC_FROM_ADDR $DB_IC_NB_SYNC_FROM_PROTO \ - $DB_IC_NB_SYNC_FROM_PORT $ic_nb_active_conf_file ovn_ic_nb_db.ctl + $DB_IC_NB_SYNC_FROM_PORT $ic_nb_active_conf_file $DB_IC_NB_CTRL_SOCK } demote_ic_sb() { demote_xx_ovsdb $DB_IC_SB_SYNC_FROM_ADDR $DB_IC_SB_SYNC_FROM_PROTO \ - $DB_IC_SB_SYNC_FROM_PORT $ic_sb_active_conf_file ovn_ic_sb_db.ctl + $DB_IC_SB_SYNC_FROM_PORT $ic_sb_active_conf_file $DB_IC_SB_CTRL_SOCK } promote_xx_ovsdb() { local active_conf_file=$1 local ctl_file=$2 rm -f $active_conf_file - ovn-appctl -t $OVN_RUNDIR/$2 ovsdb-server/disconnect-active-ovsdb-server + ovn-appctl -t $ctl_file ovsdb-server/disconnect-active-ovsdb-server } promote_ovnnb() { - promote_xx_ovsdb $ovnnb_active_conf_file ovnnb_db.ctl + promote_xx_ovsdb $ovnnb_active_conf_file $DB_NB_CTRL_SOCK } promote_ovnsb() { - promote_xx_ovsdb $ovnsb_active_conf_file ovnsb_db.ctl + promote_xx_ovsdb $ovnsb_active_conf_file $DB_SB_CTRL_SOCK } promote_ic_nb() { - promote_xx_ovsdb $ic_nb_active_conf_file ovn_ic_nb_db.ctl + promote_xx_ovsdb $ic_nb_active_conf_file $DB_IC_NB_CTRL_SOCK } promote_ic_sb() { - promote_xx_ovsdb $ic_sb_active_conf_file ovn_ic_sb_db.ctl + promote_xx_ovsdb $ic_sb_active_conf_file $DB_IC_SB_CTRL_SOCK } start_ovsdb__() { @@ -354,14 +354,15 @@ start_ic_ovsdb () { } sync_status() { - ovn-appctl -t $OVN_RUNDIR/ovn${1}_db.ctl ovsdb-server/sync-status | awk '{if(NR==1) print $2}' + local ctl_file=$1 + ovn-appctl -t $ctl_file ovsdb-server/sync-status | awk '{if(NR==1) print $2}' } status_ovnnb() { if ! pidfile_is_running $DB_NB_PID; then echo "not-running" else - echo "running/$(sync_status nb)" + echo "running/$(sync_status $DB_NB_CTRL_SOCK)" fi } @@ -369,7 +370,7 @@ status_ovnsb() { if ! pidfile_is_running $DB_SB_PID; then echo "not-running" else - echo "running/$(sync_status sb)" + echo "running/$(sync_status $DB_SB_CTRL_SOCK)" fi } @@ -391,7 +392,7 @@ status_ic_nb() { if ! pidfile_is_running $DB_IC_NB_PID; then echo "not-running" else - echo "running/$(sync_status ic_nb)" + echo "running/$(sync_status $DB_IC_NB_CTRL_SOCK)" fi } @@ -399,7 +400,7 @@ status_ic_sb() { if ! pidfile_is_running $DB_IC_SB_PID; then echo "not-running" else - echo "running/$(sync_status ic_sb)" + echo "running/$(sync_status $DB_IC_SB_CTRL_SOCK)" fi } @@ -961,6 +962,8 @@ File location options: --db-nb-port=PORT OVN Northbound db ptcp port (default: $DB_NB_PORT) --db-sb-addr=ADDR OVN Southbound db ptcp address (default: $DB_SB_ADDR) --db-sb-port=PORT OVN Southbound db ptcp port (default: $DB_SB_PORT) + --db-nb-ctrl-sock=SOCKET OVN_Northbound db control socket (default: $DB_NB_CTRL_SOCK) + --db-sb-ctrl-sock=SOCKET OVN_Southbound db control socket (default: $DB_SB_CTRL_SOCK) --ovn-nb-logfile=FILE OVN Northbound log file (default: $OVN_NB_LOGFILE) --ovn-sb-logfile=FILE OVN Southbound log file (default: $OVN_SB_LOGFILE) --db-nb-sync-from-addr=ADDR OVN Northbound active db tcp address (default: $DB_NB_SYNC_FROM_ADDR) @@ -1011,6 +1014,8 @@ File location options: --db-ic-nb-port=PORT OVN IC Northbound db ptcp port (default: $DB_IC_NB_PORT) --db-ic-sb-addr=ADDR OVN IC Southbound db ptcp address (default: $DB_IC_SB_ADDR) --db-ic-sb-port=PORT OVN IC Southbound db ptcp port (default: $DB_IC_SB_PORT) + --db-ic-nb-ctrl-sock=SOCKET OVN_IC_Northbound db control socket (default: $DB_IC_NB_CTRL_SOCK) + --db-ic-sb-ctrl-sock=SOCKET OVN_IC_Southbound db control socket (default: $DB_IC_SB_CTRL_SOCK) --ovn-ic-nb-logfile=FILE OVN IC Northbound log file (default: $OVN_IC_NB_LOGFILE) --ovn-ic-sb-logfile=FILE OVN IC Southbound log file (default: $OVN_IC_SB_LOGFILE) --db-ic-nb-sync-from-addr=ADDR OVN IC Northbound active db tcp address (default: $DB_IC_NB_SYNC_FROM_ADDR) From patchwork Thu Dec 16 03:26:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1568880 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.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4JDyFt0yDCz9s1l for ; Thu, 16 Dec 2021 14:26:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C11C741547; Thu, 16 Dec 2021 03:26:39 +0000 (UTC) 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 DZp2povDkppD; Thu, 16 Dec 2021 03:26:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id E382E4018E; Thu, 16 Dec 2021 03:26:37 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B8478C0038; Thu, 16 Dec 2021 03:26:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5B022C0012 for ; Thu, 16 Dec 2021 03:26:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C84D882C75 for ; Thu, 16 Dec 2021 03:26:34 +0000 (UTC) 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 xzi6LPEMKuMS for ; Thu, 16 Dec 2021 03:26:33 +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 smtp1.osuosl.org (Postfix) with ESMTPS id 6807A81B26 for ; Thu, 16 Dec 2021 03:26:33 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id E9DBCFF804; Thu, 16 Dec 2021 03:26:29 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 15 Dec 2021 22:26:23 -0500 Message-Id: <20211216032623.2593374-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 2/4] ovn-ctl: allow overriding the database pidfile path 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 Submitted-at: https://github.com/ovn-org/ovn/pull/109 Signed-off-by: Dan Williams --- utilities/ovn-ctl | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index e31469535f..805966ee46 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -46,11 +46,11 @@ pidfile_is_running () { } >/dev/null 2>&1 stop_nb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnnb_db $DB_NB_PID $DB_NB_CTRL_SOCK + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnnb_db $DB_NB_PIDFILE $DB_NB_CTRL_SOCK } stop_sb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnsb_db $DB_SB_PID $DB_SB_CTRL_SOCK + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovnsb_db $DB_SB_PIDFILE $DB_SB_CTRL_SOCK } stop_ovsdb () { @@ -59,11 +59,11 @@ stop_ovsdb () { } stop_ic_nb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_nb_db $DB_IC_NB_PID $DB_IC_NB_CTRL_SOCK + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_nb_db $DB_IC_NB_PIDFILE $DB_IC_NB_CTRL_SOCK } stop_ic_sb_ovsdb() { - OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_sb_db $DB_IC_SB_PID $DB_IC_SB_CTRL_SOCK + OVS_RUNDIR=${OVS_RUNDIR} stop_ovn_daemon ovn_ic_sb_db $DB_IC_SB_PIDFILE $DB_IC_SB_CTRL_SOCK } stop_ic_ovsdb () { @@ -165,7 +165,7 @@ start_ovsdb__() { local ovn_db_ssl_key local ovn_db_ssl_cert local ovn_db_ssl_cacert - eval db_pid_file=\$DB_${DB}_PID + 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 eval cluster_local_proto=\$DB_${DB}_CLUSTER_LOCAL_PROTO @@ -359,7 +359,7 @@ sync_status() { } status_ovnnb() { - if ! pidfile_is_running $DB_NB_PID; then + if ! pidfile_is_running $DB_NB_PIDFILE; then echo "not-running" else echo "running/$(sync_status $DB_NB_CTRL_SOCK)" @@ -367,7 +367,7 @@ status_ovnnb() { } status_ovnsb() { - if ! pidfile_is_running $DB_SB_PID; then + if ! pidfile_is_running $DB_SB_PIDFILE; then echo "not-running" else echo "running/$(sync_status $DB_SB_CTRL_SOCK)" @@ -375,13 +375,13 @@ status_ovnsb() { } status_ovsdb () { - if ! pidfile_is_running $DB_NB_PID; then + if ! pidfile_is_running $DB_NB_PIDFILE; then log_success_msg "OVN Northbound DB is not running" else log_success_msg "OVN Northbound DB is running" fi - if ! pidfile_is_running $DB_SB_PID; then + if ! pidfile_is_running $DB_SB_PIDFILE; then log_success_msg "OVN Southbound DB is not running" else log_success_msg "OVN Southbound DB is running" @@ -389,7 +389,7 @@ status_ovsdb () { } status_ic_nb() { - if ! pidfile_is_running $DB_IC_NB_PID; then + if ! pidfile_is_running $DB_IC_NB_PIDFILE; then echo "not-running" else echo "running/$(sync_status $DB_IC_NB_CTRL_SOCK)" @@ -397,7 +397,7 @@ status_ic_nb() { } status_ic_sb() { - if ! pidfile_is_running $DB_IC_SB_PID; then + if ! pidfile_is_running $DB_IC_SB_PIDFILE; then echo "not-running" else echo "running/$(sync_status $DB_IC_SB_CTRL_SOCK)" @@ -405,13 +405,13 @@ status_ic_sb() { } status_ic_ovsdb () { - if ! pidfile_is_running $DB_IC_NB_PID; then + if ! pidfile_is_running $DB_IC_NB_PIDFILE; then log_success_msg "OVN IC-Northbound DB is not running" else log_success_msg "OVN IC-Northbound DB is running" fi - if ! pidfile_is_running $DB_IC_SB_PID; then + if ! pidfile_is_running $DB_IC_SB_PIDFILE; then log_success_msg "OVN IC-Southbound DB is not running" else log_success_msg "OVN IC-Southbound DB is running" @@ -443,11 +443,11 @@ start_northd () { if test X"$OVN_MANAGE_OVSDB" = Xyes; then start_ovsdb - if ! pidfile_is_running $DB_NB_PID; then + if ! pidfile_is_running $DB_NB_PIDFILE; then log_failure_msg "OVN Northbound DB is not running" exit fi - if ! pidfile_is_running $DB_SB_PID; then + if ! pidfile_is_running $DB_SB_PIDFILE; then log_failure_msg "OVN Southbound DB is not running" exit fi @@ -663,7 +663,7 @@ set_defaults () { OVN_RUNDIR=${OVN_RUNDIR:-${ovn_rundir}} DB_NB_SOCK=$OVN_RUNDIR/ovnnb_db.sock - DB_NB_PID=$OVN_RUNDIR/ovnnb_db.pid + DB_NB_PIDFILE=$OVN_RUNDIR/ovnnb_db.pid DB_NB_CTRL_SOCK=$OVN_RUNDIR/ovnnb_db.ctl DB_NB_FILE=$ovn_dbdir/ovnnb_db.db DB_NB_ADDR=0.0.0.0 @@ -674,7 +674,7 @@ set_defaults () { DB_NB_PROBE_INTERVAL_TO_ACTIVE=60000 DB_SB_SOCK=$OVN_RUNDIR/ovnsb_db.sock - DB_SB_PID=$OVN_RUNDIR/ovnsb_db.pid + DB_SB_PIDFILE=$OVN_RUNDIR/ovnsb_db.pid DB_SB_CTRL_SOCK=$OVN_RUNDIR/ovnsb_db.ctl DB_SB_FILE=$ovn_dbdir/ovnsb_db.db DB_SB_ADDR=0.0.0.0 @@ -685,7 +685,7 @@ set_defaults () { DB_SB_PROBE_INTERVAL_TO_ACTIVE=60000 DB_IC_NB_SOCK=$OVN_RUNDIR/ovn_ic_nb_db.sock - DB_IC_NB_PID=$OVN_RUNDIR/ovn_ic_nb_db.pid + DB_IC_NB_PIDFILE=$OVN_RUNDIR/ovn_ic_nb_db.pid DB_IC_NB_CTRL_SOCK=$OVN_RUNDIR/ovn_ic_nb_db.ctl DB_IC_NB_FILE=$ovn_dbdir/ovn_ic_nb_db.db DB_IC_NB_ADDR=0.0.0.0 @@ -695,7 +695,7 @@ set_defaults () { DB_IC_NB_SYNC_FROM_PORT=6645 DB_IC_SB_SOCK=$OVN_RUNDIR/ovn_ic_sb_db.sock - DB_IC_SB_PID=$OVN_RUNDIR/ovn_ic_sb_db.pid + DB_IC_SB_PIDFILE=$OVN_RUNDIR/ovn_ic_sb_db.pid DB_IC_SB_CTRL_SOCK=$OVN_RUNDIR/ovn_ic_sb_db.ctl DB_IC_SB_FILE=$ovn_dbdir/ovn_ic_sb_db.db DB_IC_SB_ADDR=0.0.0.0 @@ -956,6 +956,8 @@ File location options: --db-sb-sock=SOCKET OVN_Southbound db socket (default: $DB_SB_SOCK) --db-nb-file=FILE OVN_Northbound db file (default: $DB_NB_FILE) --db-sb-file=FILE OVN_Southbound db file (default: $DB_SB_FILE) + --db-nb-pidfile=FILE OVN_Northbound db pidfile (default: $DB_NB_PIDFILE) + --db-sb-pidfile=FILE OVN_Southbound db pidfile (default: $DB_SB_PIDFILE) --db-nb-schema=FILE OVN_Northbound db file (default: $DB_NB_SCHEMA) --db-sb-schema=FILE OVN_Southbound db file (default: $DB_SB_SCHEMA) --db-nb-addr=ADDR OVN Northbound db ptcp address (default: $DB_NB_ADDR) @@ -1008,6 +1010,8 @@ File location options: --db-ic-sb-sock=SOCKET OVN_IC_Southbound db socket (default: $DB_IC_SB_SOCK) --db-ic-nb-file=FILE OVN_IC_Northbound db file (default: $DB_IC_NB_FILE) --db-ic-sb-file=FILE OVN_IC_Southbound db file (default: $DB_IC_SB_FILE) + --db-ic-nb-pidfile=FILE OVN_IC_Northbound db pidfile (default: $DB_IC_NB_PIDFILE) + --db-ic-sb-pidfile=FILE OVN_IC_Southbound db pidfile (default: $DB_IC_SB_PIDFILE) --db-ic-nb-schema=FILE OVN_IC_Northbound db file (default: $DB_IC_NB_SCHEMA) --db-ic-sb-schema=FILE OVN_IC_Southbound db file (default: $DB_IC_SB_SCHEMA) --db-ic-nb-addr=ADDR OVN IC Northbound db ptcp address (default: $DB_IC_NB_ADDR) From patchwork Thu Dec 16 03:26:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1568881 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.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 4JDyGD4g2Pz9s1l for ; Thu, 16 Dec 2021 14:27:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 939F240AE6; Thu, 16 Dec 2021 03:26: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 uk3A1s4TNsgU; Thu, 16 Dec 2021 03:26:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id B27A240AD9; Thu, 16 Dec 2021 03:26:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 86F5BC001E; Thu, 16 Dec 2021 03:26:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 84D3AC0012 for ; Thu, 16 Dec 2021 03:26:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 76B7A831F1 for ; Thu, 16 Dec 2021 03:26:51 +0000 (UTC) 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 t9q6o9U7h1Db for ; Thu, 16 Dec 2021 03:26:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9F7AE82E1A for ; Thu, 16 Dec 2021 03:26:50 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 62E9CE0003; Thu, 16 Dec 2021 03:26:48 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 15 Dec 2021 22:26:42 -0500 Message-Id: <20211216032642.2593811-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 3/4] ovn-ctl: pass database socket to ovn-*ctl init 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 Otherwise they disagree on socket paths if the user overrides the default path. Submitted-at: https://github.com/ovn-org/ovn/pull/109 Signed-off-by: Dan Williams --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 805966ee46..45ad197059 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -305,7 +305,7 @@ $cluster_remote_port # Initialize the database if it's NOT joining a cluster. if test -z "$cluster_remote_addr"; then - $(echo ovn-${db}ctl | tr _ -) --no-leader-only init + $(echo ovn-${db}ctl | tr _ -) --no-leader-only --db="unix:$sock" init fi if test $mode = cluster; then 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 \