[ovs-git] [ovn-org/ovn] 7f8bb3: Fix connection string in case of changes in the ov...

Michele Baldessari noreply at github.com
Thu Mar 25 12:41:44 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: 7f8bb3f2f77567d8fb30657ad5c3a9408692d6b5
      https://github.com/ovn-org/ovn/commit/7f8bb3f2f77567d8fb30657ad5c3a9408692d6b5
  Author: Michele Baldessari <michele at acksyn.org>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M utilities/ovndb-servers.ocf

  Log Message:
  -----------
  Fix connection string in case of changes in the ovndb-servers.ocf RA

Currently if you update the master_ip attribute, pacemaker will restart
the resource but the ovn master role will still listen to the previous
old ip address. The reason for this is the following piece of code:

  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}\:${LISTEN_ON_IP}" \
      inactivity_probe=$INACTIVE_PROBE -- set NB_Global . connections=@conn_uuid
  fi

Once the connection is set the first time 'get NB_global . connections'
will always return the UUID of the connection so we're never changing
the connection data.

Let's set the connection info whenever the connection is not "[]"

Tested as follows:
1) Started with the following listening ip addresses (resource is configured with master_ip=172.17.1.44):
tcp   LISTEN 0      10        172.17.1.44:6641       0.0.0.0:*    users:(("ovsdb-server",pid=150360,fd=15)) ino:18609895 sk:4d <->
tcp   LISTEN 0      10        172.17.1.44:6642       0.0.0.0:*    users:(("ovsdb-server",pid=150379,fd=15)) ino:18609038 sk:4e <->

2) Updated the resource master_ip with:
pcs resource update ovndb_servers master_ip=4.5.6.7

3) Observed the new listening ip addresses on the master node:
[root at controller-3 stdouts]# ss -natulpe |grep 664[12]
tcp   LISTEN 0      10            4.5.6.7:6641       0.0.0.0:*    users:(("ovsdb-server",pid=516770,fd=15)) ino:11641860 sk:4d <->
tcp   LISTEN 0      10            4.5.6.7:6642       0.0.0.0:*    users:(("ovsdb-server",pid=516789,fd=15)) ino:11642885 sk:4e <->

Previously we'd observe ovsdb-server listening to the old IP even after
the resource change.

Signed-off-by: Michele Baldessari <michele at acksyn.org>
Signed-off-by: Numan Siddique <numans at ovn.org>




More information about the git mailing list