ClusterLabs / ClusterLabs/crmsh

False positive Qdevice vote warning during cluster start

Open Beginner friendly
#2,146 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
143
Forks
96
Avg merge
2d 6h
Merged PRs (30d)
16

Description

### Describe the bug

When starting a cluster with Qdevice using `crm cluster start`, a warning is sometimes displayed indicating that Qdevice's vote is 0:

```
INFO: Starting and enable pacemaker.service on ha-3-2
INFO: The cluster stack started on ha-3-2
WARNING: Qdevice's vote is 0, which simply means Qdevice can't talk to Qnetd(ha-3-3) for various reasons.
```

However, this warning is a false positive. Corosync simply needs a bit of time to establish a connection to `qnetd` and acquire the vote.

### Technical Analysis

In `crmsh/ui_cluster.py`:
```python
if start_qdevice and success_list:
time.sleep(1)
qdevice.QDevice.check_qdevice_vote()
```

Currently, `crmsh` waits for only 1 second after starting the service before checking the Qdevice vote status using `qdevice.QDevice.check_qdevice_vote()`.

Inside `crmsh/qdevice.py`:
```python
@staticmethod
def check_qdevice_vote():
"""
Check if qdevice can contribute vote
"""
out = sh.cluster_shell().get_stdout_or_raise_error("corosync-quorumtool -s", success_exit_status={0, 2})
res = re.search(r'\s+0\s+0\s+Qdevice', out)
if res:
qnetd_host = corosync.get_value('quorum.device.net.host')
logger.warning("Qdevice's vote is 0, which simply means Qdevice can't talk to Qnetd({}) for various reasons.".format(qnetd_host))
```

Because corosync-qdevice can take several seconds to connect and retrieve the vote, checking immediately after 1 second frequently triggers this false positive warning even when everything starts up successfully.

Contributor guide

Open the contributing guide

Research direction

Start with the qdevice startup path in crmsh/ui_cluster.py and the vote check in crmsh/qdevice.py, focusing on the one-second delay and corosync-quorumtool result. Reproduce the warning with crm cluster start and verify that a successfully connecting Qdevice does not produce a false positive warning during cluster startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.