Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1891835

Summary: promoting a galera node can fail due to a race in attributes update
Product: Red Hat Enterprise Linux 8 Reporter: Damien Ciabrini <dciabrin>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.2CC: agk, cluster-maint, fdinitto, michele, pkomarov
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-4.1.1-72.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:11:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Damien Ciabrini 2020-10-27 13:47:09 UTC
Description of problem:
When the master detection takes place, the node chosen for
becoming the master is given two attributes in the CIB:
a master score and a bootstrap flag. The master score makes
pacemaker schedule a promote operation, and the bootstrap flag
drives how the galera server is started.

The order in which we set the attributes is racy; it may happen
that a promote operation is started before the current master
detection function has set the bootstrap flag, in which case
the promotion will fail.


Version-Release number of selected component (if applicable):
resource-agents-4.1.1-44.el8_2.3.x86_64

How reproducible:
Random

Steps to Reproduce:
1. deploy a 3-node galera cluster, start the resource, then stop it
2. ban resource on the two oldest resource
3. restart the remaining resource

Actual results:
sometime the promote operation gets triggered before the bootstrap flag has been set up in the CIB, and the promotion fails

Expected results:
the promotion should finish successfully

Additional info:

Comment 4 Damien Ciabrini 2020-12-04 08:51:51 UTC
The original bug is hard to reproduce as it is a race. But the fix is really just inverting two line in the agent:

@@ -587,8 +587,8 @@ detect_first_master()
     fi
 
     ocf_log info "Promoting $best_node to be our bootstrap node"
-    set_master_score $best_node
     set_bootstrap_node $best_node
+    set_master_score $best_node
 }

So a simple overcloud deployment is enough to verify that the original behaviour is preserved, and the new line ordering is enough to ensure that the fix will work as expected.

Comment 5 pkomarov 2020-12-04 23:21:35 UTC
Verified , 

[stack@undercloud-0 ~]$ ansible database -b -mshell -a'podman exec `podman ps -f name=galera-bundle -q`  sh -c "rpm -q resource-agents";rpm -q resource-agents'
[WARNING]: Found both group and host with same name: undercloud
database-0 | CHANGED | rc=0 >>
resource-agents-4.1.1-79.el8.x86_64
resource-agents-4.1.1-79.el8.x86_64
database-2 | CHANGED | rc=0 >>
resource-agents-4.1.1-79.el8.x86_64
resource-agents-4.1.1-79.el8.x86_64
database-1 | CHANGED | rc=0 >>
resource-agents-4.1.1-79.el8.x86_64
resource-agents-4.1.1-79.el8.x86_64

#testing disruptive galera scenario:

git clone -c http.sslVerify=false https://code.engineering.redhat.com/gerrit/openstack-pidone-qe

   ansible-playbook -v  openstack-pidone-qe/CI/ansible_sts/ansible_sts_composable_roles_tests.yaml --tags 06_KILL_ALL_GALERA|& tee ansible_sts_results/06_KILL_ALL_GALERA.log
   ansible-playbook -v  openstack-pidone-qe/CI/ansible_sts/ansible_sts_composable_roles_tests.yaml --tags 07_REMOVE_ALL_GRASTATE_GALERA|& tee ansible_sts_results/07_REMOVE_ALL_GRASTATE_GALERA.log
   ansible-playbook -v  openstack-pidone-qe/CI/ansible_sts/ansible_sts_composable_roles_tests.yaml --tags 09_GENERATE_BIG_DATA_GALERA|& tee ansible_sts_results/09_GENERATE_BIG_DATA_GALERA.log

#agents have recovered after all disruptive galera tests:
    * galera-bundle-0   (ocf::heartbeat:galera):         Master database-2
    * galera-bundle-1   (ocf::heartbeat:galera):         Master database-1
    * galera-bundle-2   (ocf::heartbeat:galera):         Master database-0

Comment 7 errata-xmlrpc 2021-05-18 15:11:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (resource-agents bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1736