Skip to content
New issue

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

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

Already on GitHub? # to your account

Nodeset removes zeroes(0) from node names #286

Closed
alexbozhenko opened this issue Feb 12, 2016 · 5 comments
Closed

Nodeset removes zeroes(0) from node names #286

alexbozhenko opened this issue Feb 12, 2016 · 5 comments

Comments

@alexbozhenko
Copy link
Contributor

Hello. I noticed that zeroes(0) removed from node names on this set:

$ echo "n1c01,n1c02,n1c03,n1c04,n1c05,n1c06,n1c07,n1c08,n1c09,n2c01,n2c02,n2c03,n2c04,n2c05,n2c06,n2c07,n2c08,n2c09,n3c01,n3c02,n3c03,n3c04,n3c05,n3c06,n3c07,n3c08,n3c09,n4c01,n4c02,n4c03,n4c04,n4c05,n4c06,n4c07,n4c08,n4c09" | nodeset -f

n[1-4]c[1-9]

And not everything is good on this set, where I just deleted 2 last nodes:

$ echo "n1c01,n1c02,n1c03,n1c04,n1c05,n1c06,n1c07,n1c08,n1c09,n2c01,n2c02,n2c03,n2c04,n2c05,n2c06,n2c07,n2c08,n2c09,n3c01,n3c02,n3c03,n3c04,n3c05,n3c06,n3c07,n3c08,n3c09,n4c01,n4c02,n4c03,n4c04,n4c05,n4c06,n4c07" | nodeset -f

n[1-3]c[01-09],n4c[01-07]

Compare n[1-4]c**[1-9]** vs n[1-3]c**[01-09]**,n4c[01-07]

@thiell
Copy link
Collaborator

thiell commented Feb 12, 2016

Hi @alexbozhenko,

Ugh. Thanks much for reporting! Your first example looks like a 0-padding bug. If you remove ",n4c08,n4c09" at the end, it works as expected! I will take a look at it ASAP.

@thiell thiell added this to the 1.7.1 milestone Feb 12, 2016
@thiell thiell self-assigned this Feb 12, 2016
@thiell
Copy link
Collaborator

thiell commented Feb 12, 2016

This strange behavior is due to a heuristic-folding we developed to speed up thing in some cases. When adding one more node to your last example, you triggered a different nodeset folding code where 0-padding info was badly handled. Thanks again for reporting this issue, this is very helpful.

Patch under review - https://review.gerrithub.io/262943

@thiell thiell added the WIP label Feb 12, 2016
@alexbozhenko
Copy link
Contributor Author

Hello, Thiell.

Thank you for instant fix and coolest ssh cluster software.
I confirm, that with your fix both nodeset and clush now works.

But I also noticed that clubak affected as well:

[alex@localhost tmp]$ for j in {1..4}; do for i in {01..09}; do echo "n${j}c${i}:  11:53:17 up 1 day, 49 min, 15 users,  load average: 0.07, 0.21, 0.14"; done; done   | clubak
Traceback (most recent call last):
  File "/usr/bin/clubak", line 10, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/ClusterShell/CLI/Clubak.py", line 182, in main
    clubak()
  File "/usr/lib/python2.7/site-packages/ClusterShell/CLI/Clubak.py", line 175, in clubak
    options.trace_mode, enable_nodeset_key is not False)
  File "/usr/lib/python2.7/site-packages/ClusterShell/CLI/Clubak.py", line 96, in display
    disp.print_gather(node, tree[str(node)])
  File "/usr/lib/python2.7/site-packages/ClusterShell/MsgTree.py", line 215, in __getitem__
    return self._keys[key]
KeyError: 'n1c1'

clubak -b works though:

[alex@localhost tmp]$ for j in {1..4}; do for i in {01..09}; do echo "n${j}c${i}:  11:53:17 up 1 day, 49 min, 15 users,  load average: 0.07, 0.21, 0.14"; done; done   | clubak -b
---------------
n[1-4]c[01-09] (36)
---------------
  11:53:17 up 1 day, 49 min, 15 users,  load average: 0.07, 0.21, 0.14

@thiell
Copy link
Collaborator

thiell commented Feb 12, 2016

Thanks @alexbozhenko for the feedback, much appreciated!

I will take a look at clubak too. Please note that most of clubak features are available directly through clush. For example, in that case, you can use clush -b and avoid the use of clubak at all.

@degremont
Copy link
Collaborator

@alexbozhenko FYI, the proposed patch was updated, taking into account your latest comment. All reported issues should be fixed with this version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants