From bd8d7e9695644fe4a7f178172eb42a0b5602f458 Mon Sep 17 00:00:00 2001 From: Kamoltat Date: Tue, 19 Dec 2023 20:21:50 +0000 Subject: [PATCH] src/pybind/mgr/pg_autoscaler/module.py: fix 'pg_autoscale_mode' output Problem: `ceph osd pool autoscale-status -f json` and `ceph osd pool autoscale-status` shows discrepeencies between each other in the `pg_autoscale_mode` section, when `no_autoscale` flag is set. Solution: set `pg_autoscale_mode` to `false` for both `ceph osd pool autoscale-status` and the json version of the command if `no_autoscale` is set. Fixes: https://tracker.ceph.com/issues/63860 Signed-off-by: Kamoltat --- src/pybind/mgr/pg_autoscaler/module.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index ea7c4b00b4c..2b22b75c031 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -231,7 +231,7 @@ class PgAutoscaler(MgrModule): p['pg_num_target'], # p['pg_num_ideal'], final, - 'off' if self.has_noautoscale_flag() else p['pg_autoscale_mode'], + str(p['pg_autoscale_mode']), str(p['bulk']) ]) return 0, table.get_string(), '' @@ -663,6 +663,11 @@ class PgAutoscaler(MgrModule): ret, _, _ = self._get_pool_pg_targets(osdmap, even_pools, crush_map, root_map, pool_stats, ret, threshold, 'third', overlapped_roots) + # If noautoscale flag is set, we set pg_autoscale_mode to off + if self.has_noautoscale_flag(): + for p in ret: + p['pg_autoscale_mode'] = 'off' + return (ret, root_map) def _get_pool_by_id(self, -- 2.39.5