]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonCap: Allow default osd profile to run "config rm" with restriction
authorSridhar Seshasayee <sseshasa@redhat.com>
Tue, 16 May 2023 17:29:41 +0000 (22:59 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 22 May 2023 11:40:33 +0000 (17:10 +0530)
This is a follow-up to PR: https://github.com/ceph/ceph/pull/48703.
Modify the mon caps to allow OSDs to run the "config rm" command with
restriction to remove only the following config keys from the mon store:
- osd_max_backfills
- osd_recovery_max_active(.*)
  - osd_recovery_max_active and
  - osd_recovery_max_active_(hdd|ssd)
- osd_mclock_scheduler_(.*) -> all the QoS specific config options.

The above is similar to the change in mon caps to run the "config set"
command as implemented in PR: https://github.com/ceph/ceph/pull/42853.

Fixes: https://tracker.ceph.com/issues/61155
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
(cherry picked from commit 69160081eea908ba1d5841b6b827352515fb304e)

src/mon/MonCap.cc

index 2f2378f624631d2640b4484b6041f40bc709f521..bb5e793a6ad84dbe74d3872f076db11cd6265a3b 100644 (file)
@@ -186,6 +186,11 @@ void MonCapGrant::expand_profile(const EntityName& name) const
     StringConstraint constraint(StringConstraint::MATCH_TYPE_REGEX,
                                 string("osd_mclock_max_capacity_iops_(hdd|ssd)"));
     profile_grants.push_back(MonCapGrant("config set", "name", constraint));
+    constraint = StringConstraint(StringConstraint::MATCH_TYPE_REGEX,
+                                  string("^(osd_max_backfills|") +
+                                  string("osd_recovery_max_active(.*)|") +
+                                  string("osd_mclock_scheduler_(.*))"));
+    profile_grants.push_back(MonCapGrant("config rm", "name", constraint));
   }
   if (profile == "mds") {
     profile_grants.push_back(MonCapGrant("mds", MON_CAP_ALL));