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

Han Zhou zhouhan at gmail.com
Tue Mar 17 06:35:36 UTC 2020


On Mon, Mar 16, 2020 at 8:16 PM Tao YunXiang <
taoyunxiang at cmss.chinamobile.com> wrote:
>
> 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
>      fi
>
>      if test $mode = cluster; then
> --
> 2.17.1
>
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Thanks for the revision. I applied to master after removing the below line
in commit message:

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

(Usually, notes about different versions of patches are added after the
line "---" in the patch, so that it will be ignored by git automatically.)


More information about the dev mailing list