[ovs-dev] [PATCH v2 OVN] ovn-ctl: Fix stucked while do cluster db init

Tao YunXiang taoyunxiang at cmss.chinamobile.com
Tue Mar 17 03:16:10 UTC 2020

For cluster mode, only the first server, which is the leader, in a cluster
should do init. But, sometimes, the role of the first server would transfer
leadership, so we should add --no-leader-only in case the ovn-northd stucked.

v1: ovn-ctl: Add "--no-leader-only" while cluster db init

Author: Tao YunXiang <taoyunxiang at cmss.chinamobile.com>
Co-authored-by: Liu Chang <liuchang at cmss.chinamobile.com>
Co-authored-by: Rong Yin <rongyin at cmss.chinamobile.com>
Signed-off-by: Tao YunXiang <taoyunxiang at cmss.chinamobile.com>
Signed-off-by: Liu Chang <liuchang at cmss.chinamobile.com>
Signed-off-by: Rong Yin <rongyin at cmss.chinamobile.com>

 utilities/ovn-ctl | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl
index 2a337ae27..8afe68a0a 100755
--- a/utilities/ovn-ctl
+++ b/utilities/ovn-ctl
@@ -290,10 +290,9 @@ $cluster_remote_port
     "$@" "$file"
-    # Initialize the database if it's running standalone,
-    # active-passive, or is the first server in a cluster.
+    # Initialize the database if it's NOT joining a cluster.
     if test -z "$cluster_remote_addr"; then
-        $(echo ovn-${db}ctl | tr _ -) init
+        $(echo ovn-${db}ctl | tr _ -) --no-leader-only init
     if test $mode = cluster; then

More information about the dev mailing list