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: ui_node: refactor do_clearstate #1323

Closed

Conversation

aleksei-burlakov
Copy link
Contributor

@aleksei-burlakov aleksei-burlakov commented Feb 12, 2024

Parse the cibadmin output depending on the pacemaker version.
(ref: ClusterLabs/pacemaker#3031,
cibadmin has little changed its format at Version-2.1.7).

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (e3d1170) 52.95% compared to head (a2de06b) 52.95%.

Files Patch % Lines
crmsh/ui_node.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1323      +/-   ##
==========================================
- Coverage   52.95%   52.95%   -0.01%     
==========================================
  Files          79       79              
  Lines       25056    25058       +2     
==========================================
  Hits        13269    13269              
- Misses      11787    11789       +2     

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

Copy link
Member

@gao-yan gao-yan left a comment

Choose a reason for hiding this comment

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

Thanks, @aleksei-burlakov .

Considering the scenario of rolling upgrade where there are mixed-version of cluster nodes, even if we have the updated stack on local node, crmsh has to deal with the old form of CIB since DC is still an old version.

So we don't really need to check against the pacemaker version here. We can just make crmsh recognize both old and new forms so that it handles either form that appears.

@gao-yan
Copy link
Member

gao-yan commented Feb 12, 2024

BTW, there' another reference to the "crmd" attribute for the command "crm node show":

https://github.com/ClusterLabs/crmsh/blob/master/crmsh/ui_node.py#L338

@aleksei-burlakov
Copy link
Contributor Author

BTW, there' another reference to the "crmd" attribute for the command "crm node show":

https://github.com/ClusterLabs/crmsh/blob/master/crmsh/ui_node.py#L338

Thank you, good catch!

@aleksei-burlakov
Copy link
Contributor Author

Thanks, @aleksei-burlakov .

Considering the scenario of rolling upgrade where there are mixed-version of cluster nodes, even if we have the updated stack on local node, crmsh has to deal with the old form of CIB since DC is still an old version.

So we don't really need to check against the pacemaker version here. We can just make crmsh recognize both old and new forms so that it handles either form that appears.

It makes sense.

Btw, I thought to move this logic outside, so that parsing the cib file would be agnostic to its version. I've found, that there is a class CibStatus(object): in the cibstatus.py which from its name hints to do exactly this, but after some investigation I figured out

  • first, it does a different thing
  • second, it doesn't work
  • last, there is no test covering this cibstatus.py

So I'd like also to raise these issues here in the discussion (we can emit an issue later)

@gao-yan
Copy link
Member

gao-yan commented Feb 19, 2024

Apart from the missing test coverage, the code itself looks good to me though.

@liangxin1300
Copy link
Collaborator

Apart from the missing test coverage, the code itself looks good to me though.

The CI image for the master branch seems to be broken now, I'm fixing it
Then maybe we can add a related functional test for this to make CI happy

@liangxin1300
Copy link
Collaborator

liangxin1300 commented Feb 20, 2024

Hi @aleksei-burlakov , could you please backport this to crmsh-4.6 branch? which is for 15SP6

And the commit log should be "Fix: ..... (bsc#1219831)"

Thanks!

aleksei-burlakov pushed a commit to aleksei-burlakov/crmsh that referenced this pull request Feb 20, 2024
"crm node show" and "clearstate" commands need adjustments.
The format of the output in the //node_state has little changed in
ClusterLabs/pacemaker#3031
This PR enables the crmsh understand both the new and the old format.

[crmsh-4.6] Backport ClusterLabs#1323
"crm node show" and "clearstate" commands need adjustments.
The format of the output in the //node_state has little changed in
ClusterLabs/pacemaker#3031
This PR enables the crmsh to understand both the new and the old format.
@liangxin1300
Copy link
Collaborator

I will close this PR since #1334 already merged to crmsh-4.6 and we have a plan to merge crmsh-4.6 into master in recent

@nicholasyang2022
Copy link
Collaborator

Close as this is merged into master with #1334 and #1340.

@aleksei-burlakov aleksei-burlakov deleted the do-clearstate branch July 8, 2024 09:30
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.

4 participants