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 1435982 - RabbitMQ resource agent does not form a cluster when running on pacemaker remote nodes
Summary: RabbitMQ resource agent does not form a cluster when running on pacemaker rem...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: pre-dev-freeze
: 7.4
Assignee: Peter Lemenkov
QA Contact: Udi Shkalim
URL:
Whiteboard:
Depends On: 1448646
Blocks: 1437122
TreeView+ depends on / blocked
 
Reported: 2017-03-26 12:04 UTC by Udi Shkalim
Modified: 2017-08-01 14:57 UTC (History)
13 users (show)

Fixed In Version: resource-agents-3.9.5-105.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1437122 (view as bug list)
Environment:
Last Closed: 2017-08-01 14:57:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
undercloud sosreport (17.74 MB, application/x-xz)
2017-05-25 14:42 UTC, Udi Shkalim
no flags Details
messaging sosreports (8.88 MB, application/x-xz)
2017-05-25 14:45 UTC, Udi Shkalim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1844 0 normal SHIPPED_LIVE resource-agents bug fix and enhancement update 2017-08-01 17:49:20 UTC

Description Udi Shkalim 2017-03-26 12:04:10 UTC
Description of problem:
When deploying a setup using HA composable role where the rabbitmq node is running on a pacemaker remote service, the rabbit nodes are not forming a cluster

Version-Release number of selected component (if applicable):
resource-agents-3.9.5-82.el7_3.6.x86_64

rabbitmq-server-3.6.5-1.el7ost.noarch


pacemaker-cluster-libs-1.1.15-11.el7_3.4.x86_64
pacemaker-remote-1.1.15-11.el7_3.4.x86_64
pacemaker-cli-1.1.15-11.el7_3.4.x86_64
pacemaker-1.1.15-11.el7_3.4.x86_64
puppet-pacemaker-0.5.0-1.el7ost.noarch
pacemaker-libs-1.1.15-11.el7_3.4.x86_64

openstack-tripleo-heat-templates-6.0.0-0.20170307170102.3134785.0rc2.el7ost.noarch

How reproducible:


Steps to Reproduce:
1. Deploy Composalble role of rabbitmq with pacemaker remote
2.
3.

Actual results:
rabbit is not creating a cluster

Expected results:
rabbit cluster is up and running between all rabbit nodes

Additional info:

Comment 3 Michele Baldessari 2017-03-27 10:14:25 UTC
Thanks to Damien for his big help on this!

So the reason the cluster is not forming properly on the remote node is that it never gets the list of all the nodes. The culprit is this line in the resource agent:
rmq_join_list()
{
    cibadmin -Q --xpath "//node_state[@crmd='online']//nvpair[@name='$RMQ_CRM_ATTR_COOKIE']" | grep "$RMQ_CRM_ATTR_COOKIE" | sed -n -e "s/^.*value=.\(.*\)\".*$/\1/p"
}

The above is supposed to collect all the nodes which wrote their name in attrd. The problem is that on remote nodes "crmd=online" is never true so the list is empty and so each node just starts on its own.

By changing the function to something like the following:
rmq_join_list()
{
        local join_list=$(cibadmin -Q --xpath "//node_state[@crmd='online']//nvpair[@name='$RMQ_CRM_ATTR_COOKIE']" | grep "$RMQ_CRM_ATTR_COOKIE" | sed -n -e "s/^.*value=.\(.*\)\".*$/\1/p")
        # If join_list is empty we want to check if there are any remote nodes
        # where rabbitmq is allowed to run (i.e. nodes without the crmd=online
        if [ -z "$join_list" ]; then
                # Get all the nodes written in the ATTR_COOKIE no matter if
                # they are online or not
                local remote_join_list=$(cibadmin -Q --xpath "//node_state//nvpair[@name='$RMQ_CRM_ATTR_COOKIE']" | grep "$RMQ_CRM_ATTR_COOKIE" | sed -n -e "s/^.*value=.\(.*\)\".*$/\1/p")
                # here we basically need to filter the nodes found above
                # and only use the nodes that have online=true and standby=false
                # basically we are mimicking crmd=online but for remotes
                local filter=$(crm_mon -r --as-xml | xmllint --format --xpath "//nodes//node[@online='true' and @standby='false']/@name" - | xargs -n1 echo | awk -F= '/rabbit/ {print "-e "
$2}')
                join_list="$(echo $remote_join_list | grep $filter)"
        fi
        echo $join_list
}


We were able to get a working cluster. Maybe we can get something a bit simpler than the above. Damien and I tried to mimick the crmd=online test for remotes. We did it because it was explicitly added for normal nodes via https://github.com/ClusterLabs/resource-agents/commit/ddb8e97e2860a3d375e9a422d48a0b9e0830416d 

Fabio, to your question: yes this is a rabbitmq resource agent issue on pacemaker remote only.

Am reassigning to the RA component

Comment 6 Oyvind Albrigtsen 2017-03-29 11:19:51 UTC
Link to patch: https://github.com/ClusterLabs/resource-agents/pull/959

Comment 9 Oyvind Albrigtsen 2017-04-04 10:53:14 UTC
New build with /rabbit/ removed from the awk-line.

Comment 11 Udi Shkalim 2017-05-25 14:42:18 UTC
Created attachment 1282298 [details]
undercloud sosreport

Comment 12 Udi Shkalim 2017-05-25 14:45:13 UTC
Created attachment 1282299 [details]
messaging sosreports

Comment 13 Udi Shkalim 2017-05-25 14:45:58 UTC
Overcloud failed:

Error: unable to push cib\nCall cib_apply_diff failed (-205): Update was older than existing configuration\n\n\u001b[1;31mError: pcs -f /var/lib/pacemaker/cib/puppet-cib-backup20170525-14352-79425q create failed: Error: unable to create resource/fence device 'messaging-0', 'messaging-0' already exists on this system\u001b[0m\n\u001b[1;31mError: /Stage[main]/Tripleo::Profile::Base::Pacemaker/Pacemaker::Resource::Remote[messaging-0]/Pcmk_resource[messaging-0]/ensure: change from absent to present failed: pcs -f /var/lib/pacemaker/cib/puppet-cib-backup20170525-14352-79425q create failed: Error: unable to create resource/fence device 'messaging-0', 'messaging-0' already exists on this system\u001b[0m\n",

sosreports attached.

Comment 18 Marian Krcmarik 2017-06-23 14:02:50 UTC
I am switching to VERIFIED.
First of all we have the patch in 7.3.z so we need to include that in 7.4 anyway + the problem is that the race (Bug 1448646) prevents to verify this bug easily but I applied the patch from that bug and was able to verify this bug which was already verified on 7.3.z.

Used build:

Comment 19 errata-xmlrpc 2017-08-01 14:57:40 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, 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-2017:1844


Note You need to log in before you can comment on or make changes to this bug.