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:
Mike Place 2016-06-10 15:43:08 -06:00 committed by rallytime
parent 7d940aed1f
commit 06963e0505
17 changed files with 17 additions and 17 deletions

View file

@ -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 '

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''

View file

@ -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
'''