From fb2ad2da9b76d898425c0d16f51e0cad82e7fecb Mon Sep 17 00:00:00 2001 From: Sridhar Seshasayee Date: Wed, 2 Nov 2022 20:15:05 +0530 Subject: [PATCH] osd: Reset mClock's OSD capacity config option for inactive device type Depending on the underlying device type of an OSD, the mClock's OSD capacity option of either osd_mclock_max_capacity_iops_hdd or osd_mclock_max_capacity_iops_ssd is set during OSD boot-up. Both the options have built-in defaults set. Therefore, when displaying the running configuration of an OSD, both the values would be displayed with non-zero values which could confuse/mislead a user. To address this, override the inactive device type's capacity for the OSD to '0'. For e.g., with this change, if the underlying device type for an OSD is an ssd, the cli displays the running configuration of osd_mclock_max_capacity_iops_hdd for that OSD as '0' instead of it's default value. Fixes: https://tracker.ceph.com/issues/57963 Signed-off-by: Sridhar Seshasayee (cherry picked from commit a0781c7dbd92f9185861d5509674c9643234552e) --- src/osd/scheduler/mClockScheduler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index 0f2abf87b68c..be6e00444bc5 100644 --- a/src/osd/scheduler/mClockScheduler.cc +++ b/src/osd/scheduler/mClockScheduler.cc @@ -102,9 +102,11 @@ void mClockScheduler::set_max_osd_capacity() if (is_rotational) { max_osd_capacity = cct->_conf.get_val("osd_mclock_max_capacity_iops_hdd"); + cct->_conf.set_val("osd_mclock_max_capacity_iops_ssd", "0"); } else { max_osd_capacity = cct->_conf.get_val("osd_mclock_max_capacity_iops_ssd"); + cct->_conf.set_val("osd_mclock_max_capacity_iops_hdd", "0"); } // Set per op-shard iops limit max_osd_capacity /= num_shards; -- 2.47.3