The PG autoscaler should not be active when the norecover flag is set.
As each newly split PG will need to be backfilled, it does not make sense to have the autoscaler active if the norecover flag is set.
Fixes: https://tracker.ceph.com/issues/63334
Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
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]:
"""
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)