-
Notifications
You must be signed in to change notification settings - Fork 94
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: refine change detection for crm configure
(#1466)
#1486
Conversation
…bs#1466) It is unchanged if not loaded.
…PTIONS They are only used once in ui_context. No needs to be global constants.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
or it will prevent the interactive cli entering a sublevel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks!
Please backport to crmsh-4.6 |
#1300 tried to remove unnecessary dependencies on a running pacemaker service when crmsh is not actually going to call the service. However, it removed the call to
end_game()
fromup()
andquit()
incorrectly. This made sublevelconfigure
not to have a chance to check uncommitted changes anymore, leading to a regression described in #1466.#1481 tried to fix this regression by adding the call to
end_game()
back toup()
, and check if pacemaker service is running before callingend_game()
. This is not optimal asup()
is a common method used for all sublevels and the status of pacemaker service is only related sublevelconfigure
. Checking the status of pacemaker service when using other sublevels does not make sense.This pull request uses a more straightforward method to fix the problem: improve how to detect uncommitted changes in
has_cib_changes()
.The original implementation is to check if there is any elements in change queue. This requires the in memory representation of cib to be populated, leading to an indirect dependency to pacemaker service. However, we can take advantage of a property: the in memory cib needs to be populated before doing any changes. So in the implementation can be optimized: if the in memory cib is not populated, we will know there is not any change.