Repository navigation
Closed
Labels
Corerelates to code central or existential to SaltMulti-MasterP1Priority 1ZRELEASED - 2017.7.0rc1bugbroken, incorrect, or confusing behaviorseverity-criticaltop severity, seen by most users, serious issuesseverity-high2nd top severity, seen by most users, causes major problems
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
Corerelates to code central or existential to SaltMulti-MasterP1Priority 1ZRELEASED - 2017.7.0rc1bugbroken, incorrect, or confusing behaviorseverity-criticaltop severity, seen by most users, serious issuesseverity-high2nd top severity, seen by most users, causes major problems
Activity
DmitryKuzmenko commentedon Feb 22, 2017
The problem is in the
connected_mastersfunction 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 inboto.py.But for now I don't see
connected_mastersis used anywhere more. It's called from the onlystatus.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 thestatus_masterwill only callsalt.utils.network.remote_port_tcpfunction. So I propose to remove it from there for now, and usesalt.utils.network.remote_port_tcpinstead.PR is coming.
marbx commentedon Feb 22, 2017
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?DmitryKuzmenko commentedon Feb 22, 2017
@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.marbx commentedon Feb 22, 2017
The wonders of vim :-)
Thank you