From: Sage Weil Date: Thu, 27 Mar 2014 23:38:46 +0000 (-0700) Subject: mon/OSDMonitor: prevent setting hit_set unless all OSDs support it X-Git-Tag: v0.79~73^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69321bf57fc1fc3becd402d7811d621a676d4fe1;p=ceph.git mon/OSDMonitor: prevent setting hit_set unless all OSDs support it We are using OSD_CACHEPOOL as a proxy for the support for the tiering OSDMap infrastructure. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a6954fc7cee4..be55befdd341 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3371,17 +3371,22 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, } else if (var == "hit_set_type") { if (val == "none") p.hit_set_params = HitSet::Params(); - else if (val == "bloom") { - BloomHitSet::Params *bsp = new BloomHitSet::Params; - bsp->set_fpp(g_conf->osd_pool_default_hit_set_bloom_fpp); - p.hit_set_params = HitSet::Params(bsp); - } else if (val == "explicit_hash") - p.hit_set_params = HitSet::Params(new ExplicitHashHitSet::Params); - else if (val == "explicit_object") - p.hit_set_params = HitSet::Params(new ExplicitObjectHitSet::Params); else { - ss << "unrecognized hit_set type '" << val << "'"; - return -EINVAL; + int err = check_cluster_features(CEPH_FEATURE_OSD_CACHEPOOL, ss); + if (err) + return err; + if (val == "bloom") { + BloomHitSet::Params *bsp = new BloomHitSet::Params; + bsp->set_fpp(g_conf->osd_pool_default_hit_set_bloom_fpp); + p.hit_set_params = HitSet::Params(bsp); + } else if (val == "explicit_hash") + p.hit_set_params = HitSet::Params(new ExplicitHashHitSet::Params); + else if (val == "explicit_object") + p.hit_set_params = HitSet::Params(new ExplicitObjectHitSet::Params); + else { + ss << "unrecognized hit_set type '" << val << "'"; + return -EINVAL; + } } } else if (var == "hit_set_period") { if (interr.length()) { @@ -4741,6 +4746,8 @@ done: } else if (prefix == "osd pool set") { err = prepare_command_pool_set(cmdmap, ss); + if (err == -EAGAIN) + goto wait; if (err < 0) goto reply;