mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Save an entire minion cache traversal on each master pub
We were doing an extra and unecessary full traversal of the minion cache. This refactors all returners and the master to reduce this to a single call. More work will be forthcoming to reduce this even further, especially in the context of auth lookups.
This commit is contained in:
parent
7d940aed1f
commit
06963e0505
17 changed files with 17 additions and 17 deletions
|
@ -2109,7 +2109,7 @@ class ClearFuncs(object):
|
|||
if self.opts['ext_job_cache']:
|
||||
try:
|
||||
fstr = '{0}.save_load'.format(self.opts['ext_job_cache'])
|
||||
self.mminion.returners[fstr](clear_load['jid'], clear_load)
|
||||
self.mminion.returners[fstr](clear_load['jid'], clear_load, minions=minions)
|
||||
except KeyError:
|
||||
log.critical(
|
||||
'The specified returner used for the external job cache '
|
||||
|
|
|
@ -236,7 +236,7 @@ def event_return(events):
|
|||
raise
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -184,7 +184,7 @@ def returner(load):
|
|||
return False
|
||||
|
||||
|
||||
def save_load(jid, clear_load):
|
||||
def save_load(jid, clear_load, minion=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -65,7 +65,7 @@ def returner(ret):
|
|||
'which responded with {1}'.format(signal[0], signal[1]))
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -119,7 +119,7 @@ def prep_jid(nocache=False, passed_jid=None): # pylint: disable=unused-argument
|
|||
return passed_jid if passed_jid is not None else salt.utils.jid.gen_jid()
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ def returner(ret):
|
|||
client.write(dest, json.dumps(ret[field]))
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -128,7 +128,7 @@ def returner(ret):
|
|||
log.critical('Failed to store return with InfluxDB returner: {0}'.format(ex))
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -130,7 +130,7 @@ def returner(ret):
|
|||
serv.add('jids', ret['jid'] + ',')
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -190,7 +190,7 @@ def returner(ret):
|
|||
mdb.saltReturns.insert(sdata.copy())
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load for a given job id
|
||||
'''
|
||||
|
|
|
@ -61,7 +61,7 @@ def returner(load):
|
|||
_mminion().returners['{0}.returner'.format(returner_)](load)
|
||||
|
||||
|
||||
def save_load(jid, clear_load):
|
||||
def save_load(jid, clear_load, minions=None):
|
||||
'''
|
||||
Write load to all returners in multi_returner
|
||||
'''
|
||||
|
|
|
@ -278,7 +278,7 @@ def event_return(events):
|
|||
cur.execute(sql, (tag, json.dumps(data), __opts__['id']))
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -205,7 +205,7 @@ def returner(ret):
|
|||
_close_conn(conn)
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -263,7 +263,7 @@ def event_return(events):
|
|||
__opts__['id'], time.strftime('%Y-%m-%d %H:%M:%S %z', time.localtime())))
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -181,7 +181,7 @@ def returner(ret):
|
|||
_close_conn(conn)
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -224,7 +224,7 @@ def returner(load):
|
|||
_close_conn(conn)
|
||||
|
||||
|
||||
def save_load(jid, clear_load):
|
||||
def save_load(jid, clear_load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid id
|
||||
'''
|
||||
|
|
|
@ -106,7 +106,7 @@ def returner(ret):
|
|||
pipe.execute()
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
|
@ -170,7 +170,7 @@ def returner(ret):
|
|||
_close_conn(conn)
|
||||
|
||||
|
||||
def save_load(jid, load):
|
||||
def save_load(jid, load, minions=None):
|
||||
'''
|
||||
Save the load to the specified jid
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue