]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: Add 'osd pool get threshold' command which returns the current... 68692/head
authorConnor Fawcett <connorfa@uk.ibm.com>
Wed, 13 Aug 2025 14:03:40 +0000 (15:03 +0100)
committerConnor Fawcett <connorfa@uk.ibm.com>
Tue, 5 May 2026 14:29:12 +0000 (15:29 +0100)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2291435
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
(cherry picked from commit 46346aa2d0b12e247be17ba378e5bf46e9ded5ff)

Conflicts:
    src/pybind/mgr/pg_autoscaler/module.py
- CLIReadCommand changed to PGAutoscalerCLICommand.Read due to 4aa9e246f056

doc/rados/operations/placement-groups.rst
src/pybind/mgr/pg_autoscaler/module.py

index 8177476b230955c95f63b333eba67166e7a2be99..2a3ce0115367994f36972e682f5f933b86f8a67c 100644 (file)
@@ -165,6 +165,12 @@ The output will resemble the following::
 
      ceph osd pool set threshold 2.0
 
+  To get the current ``threshold`` value, run the following command:
+
+  .. prompt:: bash #
+
+     ceph osd pool get threshold
+
 - **AUTOSCALE** is the pool's ``pg_autoscale_mode`` and is set to ``on``,
   ``off``, or ``warn``.
 
index 3e77e35f8698b4d551ca732c8fa3c4a9d171eff0..eb96766dd1a46ed83025b4c0b8246be874e1d962 100644 (file)
@@ -243,13 +243,23 @@ class PgAutoscaler(MgrModule):
     def set_scaling_threshold(self, num: float) -> Tuple[int, str, str]:
         """
         set the autoscaler threshold 
-        A.K.A. the factor by which the new PG_NUM must vary from the existing PG_NUM
+        A.K.A. the factor by which the new pg_num must vary
+        from the existing pg_num before action is taken
         """
         if num < 1.0:
             return 22, "", "threshold cannot be set less than 1.0"
         self.set_module_option("threshold", num)
         return 0, "threshold updated", ""
 
+    @PGAutoscalerCLICommand.Read("osd pool get threshold")
+    def get_scaling_threshold(self) -> Tuple[int, str, str]:
+        """
+        return the autoscaler threshold value
+        A.K.A. the factor by which the new pg_num must vary
+        from the existing pg_num before action is taken
+        """
+        return 0, str(self.get_module_option('threshold')), ''
+
     def complete_all_progress_events(self) -> None:
         for pool_id in list(self._event):
             ev = self._event[pool_id]