[ovs-git] [openvswitch/ovs] 00dbfe: OVN resource agent - make promotion synchronous

Michele Baldessari noreply at github.com
Wed Jul 17 18:11:19 UTC 2019

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 00dbfe5a3b053af08d4d41d352e9f81f68e1ab8d
  Author: Michele Baldessari <michele at acksyn.org>
  Date:   2019-07-17 (Wed, 17 Jul 2019)

  Changed paths:
    M ovn/utilities/ovndb-servers.ocf

  Log Message:
  OVN resource agent - make promotion synchronous

Currently inside the ovsdb_server_promote() function we call 'promote_ovnnb'
and 'promote_ovnsb' and then just record the new master state in the

This creates a race because those two promote commands are asynchronous
so when we exit the ovsdb_server_promote() function the underlying DBs
are not guaranteed to be in master state. That means that clients might
connect to an instance that is in read-only mode.

We add a simple sleep loop where we wait for the underlying DB state to
confirm the master state. We do not need to add a timeout loop because
in case of an issue the resource timeout set within pacemaker will kick
in and the resource agent script will be killed by pacemaker.

Tested this within an openstack environment using ovn with roughly ~20
reboots and was unable to trigger the issue (before the patch we would
trigger the issue after a couple of reboots tops).

Acked-by: Numan Siddique <nusiddiq at redhat.com>
Acked-By: Daniel Alvarez <dalvarez at redhat.com>
Signed-off-by: Michele Baldessari <michele at acksyn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list