summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/pg_autoscaler/module.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-23 16:45:13 +0000
commit389020e14594e4894e28d1eb9103c210b142509e (patch)
tree2ba734cdd7a243f46dda7c3d0cc88c2293d9699f /src/pybind/mgr/pg_autoscaler/module.py
parentAdding upstream version 18.2.2. (diff)
downloadceph-389020e14594e4894e28d1eb9103c210b142509e.tar.xz
ceph-389020e14594e4894e28d1eb9103c210b142509e.zip
Adding upstream version 18.2.3.upstream/18.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pybind/mgr/pg_autoscaler/module.py')
-rw-r--r--src/pybind/mgr/pg_autoscaler/module.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py
index ea7c4b00b..0ab263877 100644
--- a/src/pybind/mgr/pg_autoscaler/module.py
+++ b/src/pybind/mgr/pg_autoscaler/module.py
@@ -260,6 +260,13 @@ class PgAutoscaler(MgrModule):
else:
return False
+ def has_norecover_flag(self) -> bool:
+ flags = self.get_osdmap().dump().get('flags', '')
+ if 'norecover' in flags:
+ return True
+ else:
+ return False
+
@CLIWriteCommand("osd pool get noautoscale")
def get_noautoscale(self) -> Tuple[int, str, str]:
"""
@@ -321,7 +328,7 @@ class PgAutoscaler(MgrModule):
def serve(self) -> None:
self.config_notify()
while not self._shutdown.is_set():
- if not self.has_noautoscale_flag():
+ if not self.has_noautoscale_flag() and not self.has_norecover_flag():
osdmap = self.get_osdmap()
pools = osdmap.get_pools_by_name()
self._maybe_adjust(osdmap, pools)