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

"salt --subset=n" appears to always choose the same nodes #20575

Closed
starchy opened this issue Feb 10, 2015 · 4 comments
Closed

"salt --subset=n" appears to always choose the same nodes #20575

starchy opened this issue Feb 10, 2015 · 4 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@starchy
Copy link

starchy commented Feb 10, 2015

I have the following cronjob on my salt-master:
* * * * * /usr/bin/salt --subset=1 '*' state.highstate >> /var/log/salt/cron.log
If I check cron.log, I see that highstate is running on the same node every time. This node happens to be both the node most recently added and the last alphabetically, web2.example.com. The results are the same at the command line:

root@salt1:/srv# salt --subset=1 '*' test.ping
web2.example.com:
    True
root@salt1:/srv# salt --subset=1 '*' test.ping
web2.example.com:
    True

Going to --subset=2 the results are a little better, but web2 always returns, and the distribution is otherwise a bit suspicious:

root@salt1:/srv# salt --subset=2 '*' test.ping
dhcp-wireless.int.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=2 '*' test.ping
backup3.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=2 '*' test.ping
backup3.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=2 '*' test.ping
dhcp-wireless.int.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=2 '*' test.ping
dhcp-wireless.int.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=2 '*' test.ping
dhcp-wireless.int.example.com:
    True
web2.example.com:
    True

---subset=3 introduces a fourth node into the mix, but the distribution isn't any better:

root@salt1:/srv# salt --subset=3 '*' test.ping
dhcp-wireless.int.example.com:
    True
web2.example.com:
    True
jabber.example.com:
    True
root@salt1:/srv# salt --subset=3 '*' test.ping
backup3.example.com:
    True
jabber.example.com:
    True
web2.example.com:
    True
root@salt1:/srv# salt --subset=3 '*' test.ping
dhcp-wireless.int.example.com:
    True
jabber.example.com:
    True
web2.example.com:
    True

There are more than four nodes available:

root@salt1:/srv# salt '*' test.ping|grep True|wc -l
23

I'm running on Debian Wheezy.

root@salt1:/srv# salt --versions-report
           Salt: 2014.7.1
         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.6
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 13.1.0
           RAET: Not Installed
            ZMQ: 3.2.3
           Mako: 0.7.0
@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists labels Feb 11, 2015
@jfindlay jfindlay self-assigned this Feb 11, 2015
@jfindlay jfindlay added this to the Approved milestone Feb 11, 2015
@jfindlay
Copy link
Contributor

@starchy, thanks for the report.

@dmurphy18 dmurphy18 added Core relates to code central or existential to Salt P1 Priority 1 labels May 19, 2015
@ahammond
Copy link
Contributor

ahammond commented Jun 7, 2016

I've seen this behavior too. I thought it was intentional. :)

@rallytime
Copy link
Contributor

I can confirm that this behavior is fixed with #35720. Thanks @hu-dabao!

root@rallytime:~/SaltStack/salt# salt --subset=1 '*' test.ping
test-minion:
    True
root@rallytime:~/SaltStack/salt# salt --subset=1 '*' test.ping
rallytime:
    True

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Aug 24, 2016
@rallytime
Copy link
Contributor

FYI @starchy ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

5 participants