Skip to content

Head of Develop. Multi-Master Failover don't work.  #39368

Closed

Description

@frogunder

In a mulitmaster failover setup on head of develop with two masters and two minions. The minions will not failover to other master if original master is stopped.

Setup

In minion config, min1:

grep '^[^#]' /etc/salt/minion
master:
  - 173.255.213.176
  - 23.239.21.111
id: min1
master_shuffle: True
master_type: failover
master_alive_interval: 30

In minion config, min2:

grep '^[^#]' /etc/salt/minion
master:
  - 173.255.213.176
  - 23.239.21.111
id: min2
master_shuffle: True
master_type: failover
master_alive_interval: 30

Steps to Reproduce Issue

Set up multimaster failover environment with two master and two minions. Make sure minion responds only to one master, then stop that master and minions does not failover to second master.

I see this traceback in the logs on both minions:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/utils/schedule.py", line 837, in handle_func
    ret['return'] = self.functions[func](*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/salt/modules/status.py", line 1058, in master
    connected_ips = _connected_masters()
  File "/usr/lib/python2.7/site-packages/salt/utils/minion.py", line 65, in connected_masters
    config_port = __salt__['config.get']('publish_port')
NameError: global name '__salt__' is not defined

Versions Report

salt --versions
Salt Version:
           Salt: 2016.11.2-2501-g050b4cc
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.3.1611 Core
        machine: x86_64
        release: 4.8.6-x86_64-linode78
         system: Linux
        version: CentOS Linux 7.3.1611 Core
 

Activity

  1. added
    bug
    Core
    severity-high
    P1
    on Feb 13, 2017
  2. added this to the Approved milestone on Feb 13, 2017
  3. added
    severity-critical
    on Feb 13, 2017
  4. DmitryKuzmenko commented on Feb 22, 2017

    @DmitryKuzmenko
    Contributor

    The problem is in the connected_masters function itself introduced in #37832. If it uses __salt__ the __salt__ must be injected into the module by loader or module must have a guard, default __salt__ init like in boto.py.
    But for now I don't see connected_masters is used anywhere more. It's called from the only status.master. And using loader there has much unnecessary overhead. But also I don't know the original idea of introducing this function. But if port is provided outside the status_master will only call salt.utils.network.remote_port_tcp function. So I propose to remove it from there for now, and use salt.utils.network.remote_port_tcp instead.
    PR is coming.

  5. marbx commented on Feb 22, 2017

    @marbx
    Contributor

    Hi @DmitryKuzmenko,

    I am looking for a Python IDE which can find references of a function.

    How have you found that connected_masters() is not used anywhere?

  6. DmitryKuzmenko commented on Feb 22, 2017

    @DmitryKuzmenko
    Contributor

    @markuskramerIgitt !offtopic! :-P
    I've used vim's :lvimgrep /\<connected_masters\>/. But PyDev or PyCharm or just grep can do this job if you use regex.

  7. marbx commented on Feb 22, 2017

    @marbx
    Contributor

    The wonders of vim :-)

    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

CoreMulti-MasterP1ZRELEASED - 2017.7.0rc1bugseverity-criticalseverity-high

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions