mgr/cephadm: add some debug output for serve loop

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2021-11-24 09:17:03 -05:00
parent afd8be7eac
commit f10f94478f

View File

@ -59,6 +59,7 @@ class CephadmServe:
self.mgr.config_checker.load_network_config()
while self.mgr.run:
self.log.debug("serve loop start")
try:
@ -104,7 +105,9 @@ class CephadmServe:
if e.event_subject:
self.mgr.events.from_orch_error(e)
self.log.debug("serve loop sleep")
self._serve_sleep()
self.log.debug("serve loop wake")
self.log.debug("serve exit")
def _serve_sleep(self) -> None:
@ -122,6 +125,7 @@ class CephadmServe:
self.mgr.event.clear()
def _update_paused_health(self) -> None:
self.log.debug('_update_paused_health')
if self.mgr.paused:
self.mgr.set_health_warning('CEPHADM_PAUSED', 'cephadm background work is paused', 1, [
"'ceph orch resume' to resume"])
@ -174,6 +178,7 @@ class CephadmServe:
self.mgr.cache.update_autotune(host)
def _refresh_hosts_and_daemons(self) -> None:
self.log.debug('_refresh_hosts_and_daemons')
bad_hosts = []
failures = []
@ -517,6 +522,7 @@ class CephadmServe:
'CEPHADM_STRAY_DAEMON', f'{len(daemon_detail)} stray daemon(s) not managed by cephadm', len(daemon_detail), daemon_detail)
def _check_for_moved_osds(self) -> None:
self.log.debug('_check_for_moved_osds')
all_osds: DefaultDict[int, List[orchestrator.DaemonDescription]] = defaultdict(list)
for dd in self.mgr.cache.get_daemons_by_type('osd'):
assert dd.daemon_id
@ -544,6 +550,7 @@ class CephadmServe:
logger.exception(f'failed to remove duplicated daemon {e}')
def _apply_all_services(self) -> bool:
self.log.debug('_apply_all_services')
r = False
specs = [] # type: List[ServiceSpec]
# if metadata is not up to date, we still need to apply spec for agent
@ -900,6 +907,7 @@ class CephadmServe:
return r
def _check_daemons(self) -> None:
self.log.debug('_check_daemons')
daemons = self.mgr.cache.get_daemons()
daemons_post: Dict[str, List[orchestrator.DaemonDescription]] = defaultdict(list)
for dd in daemons:
@ -996,6 +1004,7 @@ class CephadmServe:
daemon_type)).daemon_check_post(daemon_descs)
def _purge_deleted_services(self) -> None:
self.log.debug('_purge_deleted_services')
existing_services = self.mgr.spec_store.all_specs.items()
for service_name, spec in list(existing_services):
if service_name not in self.mgr.spec_store.spec_deleted: