mgr/cephadm: kick serve loop if new metadata makes all hosts metadata up to date

Signed-off-by: Adam King <adking@redhat.com>
This commit is contained in:
Adam King 2021-09-23 12:41:52 -04:00
parent e2643798a9
commit d4b070e033
2 changed files with 6 additions and 0 deletions

View File

@ -187,7 +187,12 @@ class HostData:
self.mgr.cache.update_host_devices(host, ret.devices)
if up_to_date:
was_out_of_date = not self.mgr.cache.all_host_metadata_up_to_date()
self.mgr.cache.metadata_up_to_date[host] = True
if was_out_of_date and self.mgr.cache.all_host_metadata_up_to_date():
self.mgr.log.info(
'New metadata from agent has made all hosts up to date. Kicking serve loop')
self.mgr._kick_serve_loop()
self.mgr.log.info(
f'Received up-to-date metadata from agent on host {host}.')

View File

@ -605,6 +605,7 @@ class CephadmServe:
# end up stuck between wanting metadata to be up to date to apply specs
# and needing to apply the agent spec to get up to date metadata
if self.mgr.use_agent and not self.mgr.cache.all_host_metadata_up_to_date():
self.log.info('Metadata not up to date on all hosts. Skipping non agent specs')
try:
specs.append(self.mgr.spec_store['agent'].spec)
except Exception as e: