Bug 1984120

Summary: Regressions in crm_attribute in upstream Pacemaker 2.1.0
Product: Red Hat Enterprise Linux 8 Reporter: Ken Gaillot <kgaillot>
Component: pacemakerAssignee: Ken Gaillot <kgaillot>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: urgent    
Version: 8.4CC: cluster-maint, mjuricek, msmazova
Target Milestone: betaKeywords: Triaged
Target Release: 8.5   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: pacemaker-2.1.0-4.el8 Doc Type: No Doc Update
Doc Text:
The issue will not be present in GA release
Story Points: ---
Clone Of:
: 1984130 (view as bug list) Environment:
Last Closed: 2021-11-09 18:44:54 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: 1872754, 1984130    

Description Ken Gaillot 2021-07-20 17:57:17 UTC
Description of problem: RHEL 8.5 and 9.0 beta rebased on upstream 2.1.0, which has been found to have regressions in the crm_attribute command (and its crm_master and crm_failcount wrappers).


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


How reproducible: trivially


Steps to Reproduce:
1. Configure and start a cluster.
2. Use crm_attribute to set a node attribute with a negative integer value.
3. Use crm_attribute's hidden --get-value option (a deprecated alias for --query) to check an attribute value.

Actual results: Setting a negative value fails with an option parsing error. Using --get-value wrongly requires (and ignores) an option argument.


Expected results: Setting a negative value succeeds. Using --get-value does not require an option argument.

Comment 1 Ken Gaillot 2021-07-20 18:38:58 UTC
Fixed upstream by commits ea5510d and ef054d9

Comment 6 Markéta Smazová 2021-08-12 10:22:07 UTC
before fix:
-----------

>   [root@virt-021 ~]# rpm -q pacemaker
>   pacemaker-2.1.0-3.el8.x86_64

Setup a cluster:

>   [root@virt-021 ~]# pcs status
>   Cluster name: STSRHTS1878
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-023 (version 2.1.0-3.el8-7c3f660707) - partition with quorum
>     * Last updated: Thu Aug 12 12:16:06 2021
>     * Last change:  Thu Aug 12 12:16:03 2021 by root via crm_attribute on virt-023
>     * 2 nodes configured
>     * 2 resource instances configured

>   Node List:
>     * Online: [ virt-021 virt-023 ]

>   Full List of Resources:
>     * fence-virt-021	(stonith:fence_xvm):	 Started virt-021
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023

>   Daemon Status:
>     corosync: active/disabled
>     pacemaker: active/disabled
>     pcsd: active/enabled

Set a node attribute with a negative integer value. Use crm_attribute's hidden `--get-value` option 
(a deprecated alias for `--query`) to check an attribute value:

>   [root@virt-021 ~]# crm_attribute --node virt-021 --name test2 --update -22
>   crm_attribute: Unknown option -2
>   [root@virt-021 ~]# echo $?
>   64
Setting a negative value failed with an option parsing error.

>   [root@virt-021 ~]# crm_attribute --node virt-021 --name test2 --get-value
>   crm_attribute: Missing argument for --get-value

Using `--get-value` wrongly requires (and ignores) an option argument.



after fix:
----------

>   [root@virt-542 ~]# rpm -q pacemaker
>   pacemaker-2.1.0-5.el8.x86_64

Setup a cluster:

>   [root@virt-542 ~]# pcs status
>   Cluster name: STSRHTS30566
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-543 (version 2.1.0-5.el8-7c3f660707) - partition with quorum
>     * Last updated: Thu Aug 12 12:17:45 2021
>     * Last change:  Thu Aug 12 12:17:37 2021 by root via crm_attribute on virt-542
>     * 2 nodes configured
>     * 2 resource instances configured

>   Node List:
>     * Online: [ virt-542 virt-543 ]

>   Full List of Resources:
>     * fence-virt-542	(stonith:fence_xvm):	 Started virt-542
>     * fence-virt-543	(stonith:fence_xvm):	 Started virt-543

>   Daemon Status:
>     corosync: active/disabled
>     pacemaker: active/disabled
>     pcsd: active/enabled

Set a node attribute with a negative integer value. Use crm_attribute's hidden `--get-value` option 
(a deprecated alias for `--query`) to check an attribute value:

>   [root@virt-542 ~]# crm_attribute --node virt-542 --name test2 --update -22
>   [root@virt-542 ~]# echo $?
>   0
Setting a negative value succeeded.

>   [root@virt-542 ~]# crm_attribute --node virt-542 --name test2 --get-value
>   scope=nodes  name=test2 value=-22

Using `--get-value` does not require an option argument.


Display cluster with Node Attributes:

>   [root@virt-542 ~]# crm_mon -1A
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-543 (version 2.1.0-5.el8-7c3f660707) - partition with quorum
>     * Last updated: Thu Aug 12 11:50:30 2021
>     * Last change:  Thu Aug 12 11:49:19 2021 by root via crm_attribute on virt-542
>     * 2 nodes configured
>     * 2 resource instances configured

>   Node List:
>     * Online: [ virt-542 virt-543 ]

>   Active Resources:
>     * fence-virt-542	(stonith:fence_xvm):	 Started virt-542
>     * fence-virt-543	(stonith:fence_xvm):	 Started virt-543

>   Node Attributes:
>     * Node: virt-542:
>       * test2                           	: -22



marking verified in pacemaker-2.1.0-5.el8

Comment 8 errata-xmlrpc 2021-11-09 18:44:54 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 (pacemaker 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/RHEA-2021:4267