Bug 2216308

Summary: pcp hacluster pmda doesn't report dc status properly
Product: Red Hat Enterprise Linux 9 Reporter: Ross Sponhholtz <ross>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact: Jacob Taylor Valdez <jvaldez>
Priority: unspecified    
Version: 9.2CC: jkurik, ksatarin, nathans, pevans, radeltch, scox
Target Milestone: rcKeywords: Bugfix, Triaged, ZStream
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pcp-6.0.5-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2219731 2222858 (view as bug list) Environment:
Last Closed: 2023-11-07 08:30:40 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:
Bug Depends On:    
Bug Blocks: 2219731, 2222858    

Description Ross Sponhholtz 2023-06-20 19:40:40 UTC
Description of problem:
The hacluster pmda in pcp executes the "crm_mon -X --inactive" command to retrieve cluster information.  In RHEL 9.x, the format of the output of that command has changed somewhat, as compared to previous versions.  Due to this, the PMDA does not process this data correctly, and returns incorrect data.  

Version-Release number of selected component (if applicable):
9.2 

How reproducible:
100%

Steps to Reproduce:
1.set up RHEL 9.2 cluster
2.set up pcp, pmproxy, and hacluster PMDA
3. perform curl http://localhost:44322/metrics?names=ha_cluster| grep ha_cluster_pacemaker_nodes_status_dc


Actual results:
# TYPE ha_cluster_pacemaker_nodes_status_dc gauge
ha_cluster_pacemaker_nodes_status_dc{hostname="rh9dhdb00l1c0",instname="rh9dhdb00l0c0",machineid="dc7028ce53a64b0bba7d52ee52cf568a",domainname="localdomain",instid="0"} 0
ha_cluster_pacemaker_nodes_status_dc{hostname="rh9dhdb00l1c0",instname="rh9dhdb00l1c0",machineid="dc7028ce53a64b0bba7d52ee52cf568a",domainname="localdomain",instid="1"} 0


Expected results:
since every cluster has one DC, the command in #3 should return at least one line that has value of 1

Additional info:
"crm_mon -C --inactive" is now returning some extra fields "health" and "feature_set": 
   <node name="rh9dhdb00l0c0" id="1" online="true" standby="false" standby_onfail="false" maintenance="false" pending="false" unclean="false" health="green" feature_set="3.16.2" shutdown="false" expected_up="true" is_dc="false" resources_running="5" type="member"/>

The processing of these in the pmda pacemaker.c has not taken into account these new fields (see line 537 in https://github.com/performancecopilot/pcp/blob/177b3d6294eb6b6bc3e2d9dcafdc09b6930554af/src/pmdas/hacluster/pacemaker.c).

Comment 1 Nathan Scott 2023-06-21 02:04:26 UTC
Thanks Ross, yep, looks like we have some work to do here.

I've CC'd my colleague Paul Evans who knows this code best for his input.
One thing we'll need will be captured output of the command in the updated
format to use in PCP regression test qa/1897 (in the pcp github repo) - in
the form of qa/hacluster/hacluster-root-001.tgz there.

Paul, do you have a hacluster test setup handy where you can capture that?
And do you have cycles to update the code? (I can help with that if needed
once we have the test data to work with).

cheers.

Comment 2 Ross Sponhholtz 2023-06-21 17:32:21 UTC
I have a 9.2 cluster that I've been testing with, and I put sample output from crm_mon -X in a github repo here: https://bugzilla.redhat.com/show_bug.cgi?id=2216308
I threw together a little program (in the github) to test this out, and updated for the 9.2 output.

Let me know if there is anything I can do to help, since getting this corrected is pretty important for our support of RHEL 9.2 in Azure Monitor for SAP Solutions.

Comment 3 Ross Sponhholtz 2023-06-21 17:33:46 UTC
sorry here is my github: https://github.com/rsponholtz/pmtest

Comment 4 Nathan Scott 2023-06-22 07:39:45 UTC
Thanks Ross.  I'm away until July 3rd so I am hoping Paul has some cycles to make progress while I'm away.
Otherwise I'll take you up on that kind offer for assistance and work with you to get this resolved shortly after I return.

Comment 5 Paul Evans 2023-06-22 11:36:46 UTC
Hi Nathan, Ross.

It looks like pacemaker 2.1.5 added the extra fields to the output from crm_mon
which causes the issue for collecting the ha_cluster_pacemaker_nodes_status_dc.
I've attached a patch which will fix this issue for RHEL 9.2 (I believe this
could be an issue in RHEL8.8 also).

I've provided a merge-request for upstream also to fix this issue.

Regards,

Paul.

Comment 8 RD 2023-06-22 18:03:54 UTC
(In reply to Paul Evans from comment #5)
> Hi Nathan, Ross.
> 
> It looks like pacemaker 2.1.5 added the extra fields to the output from
> crm_mon
> which causes the issue for collecting the
> ha_cluster_pacemaker_nodes_status_dc.
> I've attached a patch which will fix this issue for RHEL 9.2 (I believe this
> could be an issue in RHEL8.8 also).
> 
> I've provided a merge-request for upstream also to fix this issue.
> 
> Regards,
> 
> Paul.

Hi,

Where do we find the attached patch?  I don't see an attachment to the BZ. 

Thanks!
Ralitza

Comment 9 Nathan Scott 2023-06-24 06:56:33 UTC
Hi Ralitza, you can find Paul's latest updates here:
https://github.com/performancecopilot/pcp/pull/1770

Comment 14 Jan Kurik 2023-06-26 13:55:22 UTC
Verifying using the upstream testsuite.

Comment 25 errata-xmlrpc 2023-11-07 08:30: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 (pcp 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-2023:6406