Fix race condition for primary component bootstrap
Create node is_pc flag before starting to check if there
is more than one of those flags. Thus, we avoid race condition
when there is 0 is_pc flags and galera starts with --wsrep-new-cluster
on 2 nodes.
We set it before the check and, as setting them is synchronous through
Pacemaker CIB, in that case when >1 nodes attempt to bootstrap with
--wsrep-new-cluster, only one node will see <= 1 is_pc flags. Others
will see more than one and fail and reattempt to start. At that point
one of the nodes will already be bootstrapped, thus reelection will not
be triggered and the section of bootstrap will be skipped
Reviewed: https:/ /review. openstack. org/462134 /git.openstack. org/cgit/ openstack/ fuel-library/ commit/ ?id=afa04a86d9e 7acb677366325ce 42cc77e0c8a324
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit afa04a86d9e7acb 677366325ce42cc 77e0c8a324
Author: Vladimir Kuklin <email address hidden>
Date: Fri Apr 28 13:43:49 2017 +0300
Fix race condition for primary component bootstrap
Create node is_pc flag before starting to check if there
is more than one of those flags. Thus, we avoid race condition
when there is 0 is_pc flags and galera starts with --wsrep-new-cluster
on 2 nodes.
We set it before the check and, as setting them is synchronous through new-cluster, only one node will see <= 1 is_pc flags. Others
Pacemaker CIB, in that case when >1 nodes attempt to bootstrap with
--wsrep-
will see more than one and fail and reattempt to start. At that point
one of the nodes will already be bootstrapped, thus reelection will not
be triggered and the section of bootstrap will be skipped
Change-Id: I82a71132eef787 7ac7ab1ed042630 44b3b1e8d9b
Closes-bug: #1617400
Signed-off-by: Sergii Golovatiuk <email address hidden>