This commit adds changes to ensure the availability score
tracking is not updated when the feature is disabled. We
will preserve the score calculated before the feature is
turned off and start updating it again when the feature
is enabled.
Fixes: https://tracker.ceph.com/issues/71494
Signed-off-by: Shraddha Agrawal <shraddhaag@ibm.com>
(cherry picked from commit
017c9b9f4fa0d3286d52b7acb7df912327b1f836)
void MgrStatMonitor::calc_pool_availability()
{
dout(20) << __func__ << dendl;
+
+ // if feature is disabled by user, do not update the uptime
+ // and downtime, exit early
+ if (!g_conf().get_val<bool>("enable_availability_tracking")) {
+ dout(20) << __func__ << " tracking availability score is disabled" << dendl;
+ return;
+ }
+
auto pool_avail_end = pool_availability.end();
for (const auto& i : digest.pool_pg_unavailable_map) {
const auto& poolid = i.first;
} else if (prefix == "osd pool availability-status") {
if (!g_conf().get_val<bool>("enable_availability_tracking")) {
ss << "availability tracking is disabled; you can enable it by setting the config option enable_availability_tracking";
- err = -EPERM;
+ err = -EOPNOTSUPP;
goto reply_no_propose;
}
TextTable tbl;