]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: don't try to write client/os tuning profiles to known offline hosts 47953/head
authorAdam King <kingamk3@gmail.com>
Wed, 17 Aug 2022 23:03:18 +0000 (19:03 -0400)
committerAdam King <adking@redhat.com>
Sat, 3 Sep 2022 17:22:35 +0000 (13:22 -0400)
Fixes: https://tracker.ceph.com/issues/57175
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit df3557200dcae2ab1b55acf616b13adfc77fc771)

src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_tuned_profiles.py
src/pybind/mgr/cephadm/tuned_profiles.py

index 2f26ca70900f757431e237f913c2f63bcf7281b5..b457202cea9b497d0f81ae2ed1e525411e32d3d4 100644 (file)
@@ -1057,6 +1057,8 @@ class CephadmServe:
                             client_files: Dict[str, Dict[str, Tuple[int, int, int, bytes, str]]],
                             host: str) -> None:
         updated_files = False
+        if host in self.mgr.offline_hosts:
+            return
         old_files = self.mgr.cache.get_host_client_files(host).copy()
         for path, m in client_files.get(host, {}).items():
             mode, uid, gid, content, digest = m
index bec433fdcb7cc983e20f836427d56328e9c2ebb2..4fea511d3458dc70727129dbc911968d92c8a516 100644 (file)
@@ -52,6 +52,7 @@ class FakeMgr:
         self.tuned_profiles = TunedProfileStore(self)
         self.tuned_profiles.profiles = profiles
         self.ssh = SSHManager(self)
+        self.offline_hosts = []
 
     def set_store(self, what: str, value: str):
         raise SaveError(f'{what}: {value}')
index f07f8f3e48fbcec670b2f459bf26d507a5ef3886..9d9e6eec2645e2924d055bbd3e630a017879bb20 100644 (file)
@@ -46,6 +46,8 @@ class TunedProfileUtils():
             self._write_tuned_profiles(host, profiles)
 
     def _remove_stray_tuned_profiles(self, host: str, profiles: List[Dict[str, str]]) -> None:
+        if host in self.mgr.offline_hosts:
+            return
         cmd = ['ls', SYSCTL_DIR]
         found_files = self.mgr.ssh.check_execute_command(host, cmd).split('\n')
         found_files = [s.strip() for s in found_files]
@@ -62,6 +64,8 @@ class TunedProfileUtils():
             self.mgr.ssh.check_execute_command(host, ['sysctl', '--system'])
 
     def _write_tuned_profiles(self, host: str, profiles: List[Dict[str, str]]) -> None:
+        if host in self.mgr.offline_hosts:
+            return
         updated = False
         for p in profiles:
             for profile_name, content in p.items():