From: Sage Weil Date: Tue, 4 May 2021 21:27:56 +0000 (-0400) Subject: mgr/cephadm: induce retune of osd memory on osd creation X-Git-Tag: v17.1.0~1976^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39550%2Fhead;p=ceph.git mgr/cephadm: induce retune of osd memory on osd creation Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/inventory.py b/src/pybind/mgr/cephadm/inventory.py index 88bf970b995e..9735181e37b9 100644 --- a/src/pybind/mgr/cephadm/inventory.py +++ b/src/pybind/mgr/cephadm/inventory.py @@ -432,6 +432,10 @@ class HostCache(): def update_autotune(self, host: str) -> None: self.last_autotune[host] = datetime_now() + def invalidate_autotune(self, host: str) -> None: + if host in self.last_autotune: + del self.last_autotune[host] + def devices_changed(self, host: str, b: List[inventory.Device]) -> bool: a = self.devices[host] if len(a) != len(b): diff --git a/src/pybind/mgr/cephadm/services/osd.py b/src/pybind/mgr/cephadm/services/osd.py index a40c2674c4bc..493995ea70f9 100644 --- a/src/pybind/mgr/cephadm/services/osd.py +++ b/src/pybind/mgr/cephadm/services/osd.py @@ -140,6 +140,7 @@ class OSDService(CephService): if created: self.mgr.cache.invalidate_host_devices(host) + self.mgr.cache.invalidate_autotune(host) return "Created osd(s) %s on host '%s'" % (','.join(created), host) else: return "Created no osd(s) on host %s; already created?" % host