Bug 1968088

Summary: Misleading error message from pcs quorum unblock if wait_for_all=0
Product: Red Hat Enterprise Linux 8 Reporter: Reid Wahl <nwahl>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 8.4CC: cluster-maint, idevat, kmalyjur, mlisik, mmazoure, mpospisi, omular, svalasti, tojeline
Target Milestone: betaKeywords: Triaged
Target Release: 8.6   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcs-0.10.11-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 14:50:42 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 Reid Wahl 2021-06-05 00:26:36 UTC
Description of problem:

On RHEL 8, if wait_for_all is not enabled and a user runs `pcs quorum unblock`, pcs always prints "unable to check quorum status" instead of "cluster is not waiting for nodes to establish quorum".

On both RHEL 7 and RHEL 8, if wait_for_all is not enabled, then there is no runtime.votequorum.wait_for_all_status key in the corosync object database. However, on RHEL 7, an attempt to get a nonexistent key returns 0, while on RHEL 8 it returns 1.

~~~
[root@fastvm-rhel-7-6-21 ~]# corosync-cmapctl -g runtime.votequorum.wait_for_all_status; echo $?
Can't get key runtime.votequorum.wait_for_all_status. Error CS_ERR_NOT_EXIST 
0

[root@fastvm-rhel-8-0-23 ~]# corosync-cmapctl -g runtime.votequorum.wait_for_all_status; echo $?
Can't get key runtime.votequorum.wait_for_all_status. Error CS_ERR_NOT_EXIST
1
~~~

In this case, pcs should still be able to print "cluster is not waiting for nodes to establish quorum". The message "unable to check quorum status" makes good sense only if we're truly unable to check quorum status (e.g., if corosync isn't running or if a command like `corosync-quorumtool -s` fails for some reason).

-----

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

pcs-0.10.8-1.el8
corosync-3.1.0-3.el8_4.1

-----

How reproducible:

Always

-----

Steps to Reproduce:

1. Disable two_node and wait_for_all in a two-node cluster.
2. Start both nodes, and then take one node offline.

[root@fastvm-rhel-8-0-23 ~]# corosync-quorumtool -s
...
Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      1
Quorum:           2 Activity blocked
Flags:            

Membership information
----------------------
    Nodeid      Votes Name
         1          1 node1 (local)


3. Run `pcs quorum unblock`.

-----

Actual results:

[root@fastvm-rhel-8-0-23 ~]# pcs quorum unblock
Error: unable to check quorum status

-----

Expected results:

[root@fastvm-rhel-8-0-23 ~]# pcs quorum unblock
Error: cluster is not waiting for nodes to establish quorum

Comment 3 Miroslav Lisik 2021-11-23 08:22:56 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.11-2.el8.x86_64

[root@r8-node-01 ~]# pcs quorum update wait_for_all=0
Checking corosync is not running on nodes...
r8-node-03: corosync is not running
r8-node-01: corosync is not running
r8-node-02: corosync is not running
Sending updated corosync.conf to nodes...
r8-node-01: Succeeded
r8-node-02: Succeeded
r8-node-03: Succeeded
[root@r8-node-01 ~]# pcs cluster start --all --wait
...
[root@r8-node-01 ~]# pcs quorum unblock 
Error: cluster is not waiting for nodes to establish quorum

Comment 8 svalasti 2022-02-22 13:02:45 UTC
## BEFORE
[root@virt-557 ~]# rpm -q pcs
pcs-0.10.11-1.el8.x86_64

[root@virt-557 ~]# pcs host auth -u hacluster -p password virt-55{7,8}
virt-558: Authorized
virt-557: Authorized

[root@virt-557 ~]# pcs cluster setup test_cluster virt-55{7,8}
No addresses specified for host 'virt-557', using 'virt-557'
No addresses specified for host 'virt-558', using 'virt-558'
Destroying cluster on hosts: 'virt-557', 'virt-558'...
virt-558: Successfully destroyed cluster
virt-557: Successfully destroyed cluster
Requesting remove 'pcsd settings' from 'virt-557', 'virt-558'
virt-557: successful removal of the file 'pcsd settings'
virt-558: successful removal of the file 'pcsd settings'
Sending 'corosync authkey', 'pacemaker authkey' to 'virt-557', 'virt-558'
virt-557: successful distribution of the file 'corosync authkey'
virt-557: successful distribution of the file 'pacemaker authkey'
virt-558: successful distribution of the file 'corosync authkey'
virt-558: successful distribution of the file 'pacemaker authkey'
Sending 'corosync.conf' to 'virt-557', 'virt-558'
virt-557: successful distribution of the file 'corosync.conf'
virt-558: successful distribution of the file 'corosync.conf'
Cluster has been successfully set up.

[root@virt-557 ~]# pcs quorum update wait_for_all=0
Checking corosync is not running on nodes...
virt-558: corosync is not running
virt-557: corosync is not running
Sending updated corosync.conf to nodes...
virt-557: Succeeded
virt-558: Succeeded

> Disabling 'two_node' on both cluster nodes...

[root@virt-557 ~]# pcs cluster start --all
virt-557: Starting Cluster...
virt-558: Starting Cluster...

[root@virt-557 ~]# pcs cluster corosync | grep "quorum" -A 4
quorum {
    provider: corosync_votequorum
    two_node: 0
    wait_for_all: 0
}

[root@virt-558 ~]# pcs cluster corosync  | grep "quorum" -A 4
quorum {
    provider: corosync_votequorum
    two_node: 0
    wait_for_all: 0
}

[root@virt-557 ~]# pcs cluster stop virt-558
Error: Stopping the node(s) will cause a loss of the quorum, use --force to override

[root@virt-557 ~]# pcs cluster stop virt-558 --force
virt-558: Stopping Cluster (pacemaker)...
virt-558: Stopping Cluster (corosync)...

[root@virt-557 ~]# corosync-quorumtool -s
Quorum information
------------------
Date:             Tue Feb 22 13:33:31 2022
Quorum provider:  corosync_votequorum
Nodes:            1
Node ID:          1
Ring ID:          1.4f7
Quorate:          No

Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      1
Quorum:           2 Activity blocked
Flags:            

Membership information
----------------------
    Nodeid      Votes Name
         1          1 virt-557 (local)

[root@virt-557 ~]# corosync-cmapctl -g runtime.votequorum.wait_for_all_status
Can't get key runtime.votequorum.wait_for_all_status. Error CS_ERR_NOT_EXIST

[root@virt-557 ~]# echo $?
1

[root@virt-557 ~]# pcs quorum unblock
Error: unable to check quorum status

[root@virt-557 ~]# echo $?
1

## AFTER
[root@virt-557 ~]# rpm -q pcs
pcs-0.10.11-2.el8.x86_64

[root@virt-557 ~]# pcs host auth -u hacluster -p password virt-55{7,8}
virt-558: Authorized
virt-557: Authorized

[root@virt-557 ~]# pcs cluster setup test_cluster virt-55{7,8}
No addresses specified for host 'virt-557', using 'virt-557'
No addresses specified for host 'virt-558', using 'virt-558'
Destroying cluster on hosts: 'virt-557', 'virt-558'...
virt-558: Successfully destroyed cluster
virt-557: Successfully destroyed cluster
Requesting remove 'pcsd settings' from 'virt-557', 'virt-558'
virt-557: successful removal of the file 'pcsd settings'
virt-558: successful removal of the file 'pcsd settings'
Sending 'corosync authkey', 'pacemaker authkey' to 'virt-557', 'virt-558'
virt-557: successful distribution of the file 'corosync authkey'
virt-557: successful distribution of the file 'pacemaker authkey'
virt-558: successful distribution of the file 'corosync authkey'
virt-558: successful distribution of the file 'pacemaker authkey'
Sending 'corosync.conf' to 'virt-557', 'virt-558'
virt-557: successful distribution of the file 'corosync.conf'
virt-558: successful distribution of the file 'corosync.conf'
Cluster has been successfully set up.

[root@virt-557 ~]# pcs quorum update wait_for_all=0
Checking corosync is not running on nodes...
virt-558: corosync is not running
virt-557: corosync is not running
Sending updated corosync.conf to nodes...
virt-557: Succeeded
virt-558: Succeeded

> Disabling 'two_node' on both cluster nodes...

[root@virt-557 ~]# pcs cluster start --all
virt-557: Starting Cluster...
virt-558: Starting Cluster...

[root@virt-557 ~]# pcs cluster corosync | grep "quorum" -A 4
quorum {
    provider: corosync_votequorum
    two_node: 0
    wait_for_all: 0
}

[root@virt-558 ~]# pcs cluster corosync  | grep "quorum" -A 4
quorum {
    provider: corosync_votequorum
    two_node: 0
    wait_for_all: 0
}

[root@virt-557 ~]# pcs cluster stop virt-558
Error: Stopping the node(s) will cause a loss of the quorum, use --force to override

[root@virt-557 ~]# pcs cluster stop virt-558 --force
virt-558: Stopping Cluster (pacemaker)...
virt-558: Stopping Cluster (corosync)...

[root@virt-557 ~]# corosync-quorumtool -s
Quorum information
------------------
Date:             Tue Feb 22 13:41:50 2022
Quorum provider:  corosync_votequorum
Nodes:            1
Node ID:          1
Ring ID:          1.504
Quorate:          No

Votequorum information
----------------------
Expected votes:   2
Highest expected: 2
Total votes:      1
Quorum:           2 Activity blocked
Flags:            

Membership information
----------------------
    Nodeid      Votes Name
         1          1 virt-557 (local)

[root@virt-557 ~]# corosync-cmapctl -g runtime.votequorum.wait_for_all_status
Can't get key runtime.votequorum.wait_for_all_status. Error CS_ERR_NOT_EXIST

[root@virt-557 ~]# echo $?
1

[root@virt-557 ~]# pcs quorum unblock
Error: cluster is not waiting for nodes to establish quorum

[root@virt-557 ~]# echo $?
1

> OK.

Comment 10 errata-xmlrpc 2022-05-10 14:50:42 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 (pcs 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-2022:1978