]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: require CRUSH_MSR if any rule is msr, even if used by no pool
authorSamuel Just <sjust@redhat.com>
Wed, 28 Aug 2024 01:54:04 +0000 (18:54 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 28 Aug 2024 04:50:02 +0000 (04:50 +0000)
OSDMap::get_features is used by
OSDMonitor::validate_crush_against_features via
OSDMap::get_min_compat_client() to check whether changes to the crushmap
will require newer features than the existing require_min_compat_client
field.

Monitor commands which create rules from ec profiles may result in msr
rules.  While it might be harmless to allow msr rules to exist as long
as there aren't any pools actually using the rule, it's probably simpler
to disallow their creation in the first place until
require_min_compat_client is updated.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/OSDMap.cc

index 35ef60201896461a1709174e1517399cc2785bd8..f10fff0e88c419551af2432d31a030093e600851 100644 (file)
@@ -1766,7 +1766,8 @@ uint64_t OSDMap::get_features(int entity_type, uint64_t *pmask) const
     features |= CEPH_FEATURE_CRUSH_TUNABLES5;
   if (crush->has_incompat_choose_args())
     features |= CEPH_FEATUREMASK_CRUSH_CHOOSE_ARGS;
-  if (crush->has_nondefault_tunables_msr())
+  if (crush->has_nondefault_tunables_msr() ||
+      crush->has_msr_rules())
     features |= CEPH_FEATURE_CRUSH_MSR;
   mask |= CEPH_FEATURES_CRUSH;
 
@@ -1793,8 +1794,6 @@ uint64_t OSDMap::get_features(int entity_type, uint64_t *pmask) const
        features |= CEPH_FEATURE_CRUSH_TUNABLES3;
       if (crush->is_v5_rule(ruleid))
        features |= CEPH_FEATURE_CRUSH_TUNABLES5;
-      if (crush->is_msr_rule(ruleid))
-       features |= CEPH_FEATURE_CRUSH_MSR;
     }
   }
   mask |= CEPH_FEATURE_OSDHASHPSPOOL | CEPH_FEATURE_OSD_CACHEPOOL;