diff mbox

[ovs-dev,2/2] ovn-ctl: Start ovn-northd even if ovsdb-servers are not running

Message ID 20170522013544.27919-1-nusiddiq@redhat.com
State Accepted
Headers show

Commit Message

Numan Siddique May 22, 2017, 1:35 a.m. UTC
From: Numan Siddique <nusiddiq@redhat.com>

When '--ovn-manage-ovsdb=no' is passed to "ovn-ctl start_northd", it
doesn't start ovsdb-servers, but it expects the ovsdb-servers to be
running. If the ovsdb-servers are not running, ovn-ctl exits without
starting ovn-northd. This could create problems when ovn-northd and
ovsdb-servers are managed separately, for example when pacemaker is
used to manage ocf:ovndb-servers and ovn-northd as separate resources.
In the cases where a slave is promoted as master, it is possible that
pacemaker might start ovn-northd service before starting
ovsdb-servers.

This patch addresses this issue by not checking the status of
ovsdb-server pids when ovn-manage-ovsdb is set to true when
'start_northd' is called. ovn-northd will eventually connect to the
ovsdb-servers when they are started. So there is no harm in removing
this check.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
---
 ovn/utilities/ovn-ctl | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index a3bdad1..bff09b6 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -188,15 +188,15 @@  start_northd () {
     if [ ! -e $ovn_northd_db_conf_file ]; then
         if test X"$OVN_MANAGE_OVSDB" = Xyes; then
             start_ovsdb
-        fi
 
-        if ! pidfile_is_running $DB_NB_PID; then
-            log_failure_msg "OVN Northbound DB is not running"
-            exit
-        fi
-        if ! pidfile_is_running $DB_SB_PID; then
-            log_failure_msg "OVN Southbound DB is not running"
-            exit
+            if ! pidfile_is_running $DB_NB_PID; then
+                log_failure_msg "OVN Northbound DB is not running"
+                exit
+            fi
+            if ! pidfile_is_running $DB_SB_PID; then
+                log_failure_msg "OVN Southbound DB is not running"
+                exit
+            fi
         fi
         ovn_northd_params="--ovnnb-db=unix:$DB_NB_SOCK --ovnsb-db=unix:$DB_SB_SOCK"
     else