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: v16.2.5~115^2~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ec0d0027b3cdf88e55a352ad87902796fd5f10c;p=ceph.git mgr/cephadm: induce retune of osd memory on osd creation Signed-off-by: Sage Weil (cherry picked from commit 821a57ceabc70e8f4dce11fd04ec20ffead3789b) --- diff --git a/src/pybind/mgr/cephadm/inventory.py b/src/pybind/mgr/cephadm/inventory.py index f66679a01a8a..7b77e223abfb 100644 --- a/src/pybind/mgr/cephadm/inventory.py +++ b/src/pybind/mgr/cephadm/inventory.py @@ -433,6 +433,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