diff mbox series

[ovs-dev,2/2] ovndb-servers.ocf: Set connections in NB and SB DB tables,

Message ID 1528486343-29875-2-git-send-email-aginwala@ebay.com
State Accepted
Headers show
Series [ovs-dev,1/2] ovn-ctl: Support NB and SB DBs to start without | expand

Commit Message

aginwala aginwala June 8, 2018, 7:32 p.m. UTC
so that we can adjust inactivity_probe for master node, while still not
listening on TCP on slave node using use_remote_in_db in ovn-ctl.

Signed-off-by: aginwala <aginwala@ebay.com>
---
 ovn/utilities/ovndb-servers.ocf | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

Comments

Han Zhou June 19, 2018, 12:44 a.m. UTC | #1
On Fri, Jun 8, 2018 at 12:32 PM, aginwala <amginwal@gmail.com> wrote:
>
> so that we can adjust inactivity_probe for master node, while still not
> listening on TCP on slave node using use_remote_in_db in ovn-ctl.
>

Minor comment: the commit message is better to have a short summary as
subject, and then the detailed descriptions.

> Signed-off-by: aginwala <aginwala@ebay.com>
> ---
>  ovn/utilities/ovndb-servers.ocf | 39
+++++++++++++++++++++++----------------
>  1 file changed, 23 insertions(+), 16 deletions(-)
>
> diff --git a/ovn/utilities/ovndb-servers.ocf
b/ovn/utilities/ovndb-servers.ocf
> index 9391b89..52141c7 100755
> --- a/ovn/utilities/ovndb-servers.ocf
> +++ b/ovn/utilities/ovndb-servers.ocf
> @@ -172,25 +172,29 @@ ovsdb_server_notify() {
>              ${OVN_CTL} --ovn-manage-ovsdb=no start_northd
>          fi
>
> -        # Not needed while listening on 0.0.0.0 as we do not want to
allow
> -        # local binds. However, it is needed if vip ip is binded to
nodes.
> -        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xyes ]; then
> -            conn=`ovn-nbctl get NB_global . connections`
> -            if [ "$conn" == "[]" ]
> -            then
> -                ovn-nbctl -- --id=@conn_uuid create Connection \
> -target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${MASTER_IP}" \
> +        # In order to over-ride inactivity_probe for LB use case, we
need to
> +        # create connection entry to listen on 0.0.0.0 for master node.
> +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> +           LISTON_ON_IP="0.0.0.0"
> +        else
> +           LISTON_ON_IP=${MASTER_IP}
> +        fi
> +        conn=`ovn-nbctl get NB_global . connections`
> +        if [ "$conn" == "[]" ]
> +        then
> +            ovn-nbctl -- --id=@conn_uuid create Connection \
> +target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${LISTON_ON_IP}" \
>  inactivity_probe=$INACTIVE_PROBE -- set NB_Global .
connections=@conn_uuid
> -            fi
> +        fi
>
> -            conn=`ovn-sbctl get SB_global . connections`
> -            if [ "$conn" == "[]" ]
> -            then
> -                ovn-sbctl -- --id=@conn_uuid create Connection \
> -target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${MASTER_IP}" \
> +        conn=`ovn-sbctl get SB_global . connections`
> +        if [ "$conn" == "[]" ]
> +        then
> +            ovn-sbctl -- --id=@conn_uuid create Connection \
> +target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${LISTON_ON_IP}" \
>  inactivity_probe=$INACTIVE_PROBE -- set SB_Global .
connections=@conn_uuid
> -            fi
>          fi
> +
>      else
>          if [ "$MANAGE_NORTHD" = "yes" ]; then
>              # Stop ovn-northd service. Set --ovn-manage-ovsdb=no so that
> @@ -355,7 +359,10 @@ ovsdb_server_start() {
>          set $@ --db-nb-sync-from-proto=${NB_MASTER_PROTO}
>          set $@ --db-sb-sync-from-port=${SB_MASTER_PORT}
>          set $@ --db-sb-sync-from-proto=${SB_MASTER_PROTO}
> -
> +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> +            set $@ --db-sb-use-remote-in-db="no"
> +            set $@ --db-nb-use-remote-in-db="no"
> +        fi
>      fi
>
>      $@ start_ovsdb
> --
> 1.9.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Acked-by: Han Zhou <hzhou8@ebay.com>
Numan Siddique June 19, 2018, 10:35 a.m. UTC | #2
On Tue, Jun 19, 2018 at 6:14 AM, Han Zhou <zhouhan@gmail.com> wrote:

>
>
> On Fri, Jun 8, 2018 at 12:32 PM, aginwala <amginwal@gmail.com> wrote:
> >
> > so that we can adjust inactivity_probe for master node, while still not
> > listening on TCP on slave node using use_remote_in_db in ovn-ctl.
> >
>
> Minor comment: the commit message is better to have a short summary as
> subject, and then the detailed descriptions.
>
> > Signed-off-by: aginwala <aginwala@ebay.com>
> > ---
> >  ovn/utilities/ovndb-servers.ocf | 39 +++++++++++++++++++++++-------
> ---------
> >  1 file changed, 23 insertions(+), 16 deletions(-)
> >
> > diff --git a/ovn/utilities/ovndb-servers.ocf
> b/ovn/utilities/ovndb-servers.ocf
> > index 9391b89..52141c7 100755
> > --- a/ovn/utilities/ovndb-servers.ocf
> > +++ b/ovn/utilities/ovndb-servers.ocf
> > @@ -172,25 +172,29 @@ ovsdb_server_notify() {
> >              ${OVN_CTL} --ovn-manage-ovsdb=no start_northd
> >          fi
> >
> > -        # Not needed while listening on 0.0.0.0 as we do not want to
> allow
> > -        # local binds. However, it is needed if vip ip is binded to
> nodes.
> > -        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xyes ]; then
> > -            conn=`ovn-nbctl get NB_global . connections`
> > -            if [ "$conn" == "[]" ]
> > -            then
> > -                ovn-nbctl -- --id=@conn_uuid create Connection \
> > -target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${MASTER_IP}" \
> > +        # In order to over-ride inactivity_probe for LB use case, we
> need to
> > +        # create connection entry to listen on 0.0.0.0 for master node.
> > +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> > +           LISTON_ON_IP="0.0.0.0"
> > +        else
> > +           LISTON_ON_IP=${MASTER_IP}
> > +        fi
> > +        conn=`ovn-nbctl get NB_global . connections`
> > +        if [ "$conn" == "[]" ]
> > +        then
> > +            ovn-nbctl -- --id=@conn_uuid create Connection \
> > +target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${LISTON_ON_IP}" \
> >  inactivity_probe=$INACTIVE_PROBE -- set NB_Global .
> connections=@conn_uuid
> > -            fi
> > +        fi
> >
> > -            conn=`ovn-sbctl get SB_global . connections`
> > -            if [ "$conn" == "[]" ]
> > -            then
> > -                ovn-sbctl -- --id=@conn_uuid create Connection \
> > -target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${MASTER_IP}" \
> > +        conn=`ovn-sbctl get SB_global . connections`
> > +        if [ "$conn" == "[]" ]
> > +        then
> > +            ovn-sbctl -- --id=@conn_uuid create Connection \
> > +target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${LISTON_ON_IP}" \
> >  inactivity_probe=$INACTIVE_PROBE -- set SB_Global .
> connections=@conn_uuid
> > -            fi
> >          fi
> > +
> >      else
> >          if [ "$MANAGE_NORTHD" = "yes" ]; then
> >              # Stop ovn-northd service. Set --ovn-manage-ovsdb=no so that
> > @@ -355,7 +359,10 @@ ovsdb_server_start() {
> >          set $@ --db-nb-sync-from-proto=${NB_MASTER_PROTO}
> >          set $@ --db-sb-sync-from-port=${SB_MASTER_PORT}
> >          set $@ --db-sb-sync-from-proto=${SB_MASTER_PROTO}
> > -
> > +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> > +            set $@ --db-sb-use-remote-in-db="no"
> > +            set $@ --db-nb-use-remote-in-db="no"
> > +        fi
> >      fi
> >
> >      $@ start_ovsdb
> > --
> > 1.9.1
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
> Acked-by: Han Zhou <hzhou8@ebay.com>
>



Acked-by: Numan Siddique <nusiddiq@redhat.com>

Agree with Han. The commit message may be a bit clearer.
aginwala June 19, 2018, 3:40 p.m. UTC | #3
Thanks guys for the review! Have sent revised one @
https://patchwork.ozlabs.org/patch/931665/ . Please review and let me know.


Regards,


On Tue, Jun 19, 2018 at 3:35 AM, Numan Siddique <nusiddiq@redhat.com> wrote:

> On Tue, Jun 19, 2018 at 6:14 AM, Han Zhou <zhouhan@gmail.com> wrote:
>
> >
> >
> > On Fri, Jun 8, 2018 at 12:32 PM, aginwala <amginwal@gmail.com> wrote:
> > >
> > > so that we can adjust inactivity_probe for master node, while still not
> > > listening on TCP on slave node using use_remote_in_db in ovn-ctl.
> > >
> >
> > Minor comment: the commit message is better to have a short summary as
> > subject, and then the detailed descriptions.
> >
> > > Signed-off-by: aginwala <aginwala@ebay.com>
> > > ---
> > >  ovn/utilities/ovndb-servers.ocf | 39 +++++++++++++++++++++++-------
> > ---------
> > >  1 file changed, 23 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/ovn/utilities/ovndb-servers.ocf
> > b/ovn/utilities/ovndb-servers.ocf
> > > index 9391b89..52141c7 100755
> > > --- a/ovn/utilities/ovndb-servers.ocf
> > > +++ b/ovn/utilities/ovndb-servers.ocf
> > > @@ -172,25 +172,29 @@ ovsdb_server_notify() {
> > >              ${OVN_CTL} --ovn-manage-ovsdb=no start_northd
> > >          fi
> > >
> > > -        # Not needed while listening on 0.0.0.0 as we do not want to
> > allow
> > > -        # local binds. However, it is needed if vip ip is binded to
> > nodes.
> > > -        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xyes ]; then
> > > -            conn=`ovn-nbctl get NB_global . connections`
> > > -            if [ "$conn" == "[]" ]
> > > -            then
> > > -                ovn-nbctl -- --id=@conn_uuid create Connection \
> > > -target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${MASTER_IP}" \
> > > +        # In order to over-ride inactivity_probe for LB use case, we
> > need to
> > > +        # create connection entry to listen on 0.0.0.0 for master
> node.
> > > +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> > > +           LISTON_ON_IP="0.0.0.0"
> > > +        else
> > > +           LISTON_ON_IP=${MASTER_IP}
> > > +        fi
> > > +        conn=`ovn-nbctl get NB_global . connections`
> > > +        if [ "$conn" == "[]" ]
> > > +        then
> > > +            ovn-nbctl -- --id=@conn_uuid create Connection \
> > > +target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${LISTON_ON_IP}" \
> > >  inactivity_probe=$INACTIVE_PROBE -- set NB_Global .
> > connections=@conn_uuid
> > > -            fi
> > > +        fi
> > >
> > > -            conn=`ovn-sbctl get SB_global . connections`
> > > -            if [ "$conn" == "[]" ]
> > > -            then
> > > -                ovn-sbctl -- --id=@conn_uuid create Connection \
> > > -target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${MASTER_IP}" \
> > > +        conn=`ovn-sbctl get SB_global . connections`
> > > +        if [ "$conn" == "[]" ]
> > > +        then
> > > +            ovn-sbctl -- --id=@conn_uuid create Connection \
> > > +target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${LISTON_ON_IP}" \
> > >  inactivity_probe=$INACTIVE_PROBE -- set SB_Global .
> > connections=@conn_uuid
> > > -            fi
> > >          fi
> > > +
> > >      else
> > >          if [ "$MANAGE_NORTHD" = "yes" ]; then
> > >              # Stop ovn-northd service. Set --ovn-manage-ovsdb=no so
> that
> > > @@ -355,7 +359,10 @@ ovsdb_server_start() {
> > >          set $@ --db-nb-sync-from-proto=${NB_MASTER_PROTO}
> > >          set $@ --db-sb-sync-from-port=${SB_MASTER_PORT}
> > >          set $@ --db-sb-sync-from-proto=${SB_MASTER_PROTO}
> > > -
> > > +        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
> > > +            set $@ --db-sb-use-remote-in-db="no"
> > > +            set $@ --db-nb-use-remote-in-db="no"
> > > +        fi
> > >      fi
> > >
> > >      $@ start_ovsdb
> > > --
> > > 1.9.1
> > >
> > > _______________________________________________
> > > dev mailing list
> > > dev@openvswitch.org
> > > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
> > Acked-by: Han Zhou <hzhou8@ebay.com>
> >
>
>
>
> Acked-by: Numan Siddique <nusiddiq@redhat.com>
>
> Agree with Han. The commit message may be a bit clearer.
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
diff mbox series

Patch

diff --git a/ovn/utilities/ovndb-servers.ocf b/ovn/utilities/ovndb-servers.ocf
index 9391b89..52141c7 100755
--- a/ovn/utilities/ovndb-servers.ocf
+++ b/ovn/utilities/ovndb-servers.ocf
@@ -172,25 +172,29 @@  ovsdb_server_notify() {
             ${OVN_CTL} --ovn-manage-ovsdb=no start_northd
         fi
 
-        # Not needed while listening on 0.0.0.0 as we do not want to allow
-        # local binds. However, it is needed if vip ip is binded to nodes.
-        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xyes ]; then
-            conn=`ovn-nbctl get NB_global . connections`
-            if [ "$conn" == "[]" ]
-            then
-                ovn-nbctl -- --id=@conn_uuid create Connection \
-target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${MASTER_IP}" \
+        # In order to over-ride inactivity_probe for LB use case, we need to
+        # create connection entry to listen on 0.0.0.0 for master node.
+        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
+           LISTON_ON_IP="0.0.0.0"
+        else
+           LISTON_ON_IP=${MASTER_IP}
+        fi
+        conn=`ovn-nbctl get NB_global . connections`
+        if [ "$conn" == "[]" ]
+        then
+            ovn-nbctl -- --id=@conn_uuid create Connection \
+target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${LISTON_ON_IP}" \
 inactivity_probe=$INACTIVE_PROBE -- set NB_Global . connections=@conn_uuid
-            fi
+        fi
 
-            conn=`ovn-sbctl get SB_global . connections`
-            if [ "$conn" == "[]" ]
-            then
-                ovn-sbctl -- --id=@conn_uuid create Connection \
-target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${MASTER_IP}" \
+        conn=`ovn-sbctl get SB_global . connections`
+        if [ "$conn" == "[]" ]
+        then
+            ovn-sbctl -- --id=@conn_uuid create Connection \
+target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${LISTON_ON_IP}" \
 inactivity_probe=$INACTIVE_PROBE -- set SB_Global . connections=@conn_uuid
-            fi
         fi
+
     else
         if [ "$MANAGE_NORTHD" = "yes" ]; then
             # Stop ovn-northd service. Set --ovn-manage-ovsdb=no so that
@@ -355,7 +359,10 @@  ovsdb_server_start() {
         set $@ --db-nb-sync-from-proto=${NB_MASTER_PROTO}
         set $@ --db-sb-sync-from-port=${SB_MASTER_PORT}
         set $@ --db-sb-sync-from-proto=${SB_MASTER_PROTO}
-
+        if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
+            set $@ --db-sb-use-remote-in-db="no"
+            set $@ --db-nb-use-remote-in-db="no"
+        fi
     fi
 
     $@ start_ovsdb