Skip to content

Commit

Permalink
ovn-ctl: Start ovn-northd even if ovsdb-servers are not running
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
  • Loading branch information
numansiddique authored and azhou-nicira committed May 22, 2017
1 parent 52727f4 commit 126fb3e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ovn/utilities/ovn-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 126fb3e

Please sign in to comment.