Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: Add error log when cluster services fail to start #1692

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

liangxin1300
Copy link
Collaborator

@liangxin1300 liangxin1300 commented Feb 19, 2025

Problem 1

crmsh will show success logs when success to start:

# crm cluster start --all
INFO: Starting pacemaker.service on alp-1, alp-2
INFO: The cluster stack started on alp-1
INFO: The cluster stack started on alp-2

But will show nothing when fail to start:

# crm cluster start --all
INFO: Starting pacemaker.service on alp-1, alp-2

Solution

# crm cluster start --all
INFO: Starting pacemaker.service on alp-1, alp-2
ERROR: The cluster stack failed to start on alp-1
INFO: The cluster stack started on alp-2

Promblem 2

When the fatal error leads to start pacemaker failing, the bootstrap process will wait for a long time:

# crm cluster init -y
...
INFO: Starting pacemaker.service on alp-1
INFO: BEGIN Waiting for cluster
.............................................................                                                                                                                                      
ERROR: FAIL Waiting for cluster
ERROR: cluster.init: Time out waiting for cluster.

Solution

check the return code and quit quickly

# crm cluster init -y
...
INFO: Starting pacemaker.service on alp-1
ERROR: cluster.init: Failed to start cluster services

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.74%. Comparing base (87655e0) to head (151788c).

Files with missing lines Patch % Lines
crmsh/bootstrap.py 50.00% 1 Missing ⚠️
crmsh/ui_cluster.py 91.66% 1 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
integration 53.61% <62.50%> (-0.01%) ⬇️
unit 53.08% <81.25%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crmsh/service_manager.py 98.07% <100.00%> (+0.03%) ⬆️
crmsh/bootstrap.py 88.04% <50.00%> (-0.06%) ⬇️
crmsh/ui_cluster.py 75.43% <91.66%> (+0.28%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liangxin1300 liangxin1300 requested a review from zzhou1 February 23, 2025 13:22
@liangxin1300 liangxin1300 marked this pull request as ready for review February 23, 2025 13:22
if start_qdevice:
qdevice.QDevice.check_qdevice_vote()

return_rc = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True or False is not a return code. Please do not name it as rc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants