# make sure we can't create an ec pool tier
ceph osd pool create eccache 2 2 erasure
+ expect_false ceph osd set-require-min-compat-client bobtail
ceph osd pool create repbase 2
expect_false ceph osd tier add repbase eccache
ceph osd pool delete repbase repbase --yes-i-really-really-mean-it
ceph osd crush set-tunable straw_calc_version 1
ceph osd crush get-tunable straw_calc_version | grep 1
+ #
+ # require-min-compat-client
+ expect_false ceph osd set-require-min-compat-client dumpling # firefly tunables
+ ceph osd set-require-min-compat-client luminous
+ ceph osd dump | grep 'require_min_compat_client luminous'
+
#
# osd scrub
#
"name=ratio,type=CephFloat,range=0.0|1.0", \
"set usage ratio at which OSDs are marked near-full",
"osd", "rw", "cli,rest")
+COMMAND("osd set-require-min-compat-client " \
+ "name=version,type=CephString",
+ "set the minimum client version we will maintain compatibility with",
+ "osd", "rw", "cli,rest")
COMMAND("osd pause", "pause osd", "osd", "rw", "cli,rest")
COMMAND("osd unpause", "unpause osd", "osd", "rw", "cli,rest")
COMMAND("osd erasure-code-profile set " \
wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
get_last_committed() + 1));
return true;
+ } else if (prefix == "osd set-require-min-compat-client") {
+ if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) {
+ ss << "you must complete the upgrade and set require_luminous_osds before"
+ << " using the new interface";
+ err = -EPERM;
+ goto reply;
+ }
+ string v;
+ cmd_getval(g_ceph_context, cmdmap, "version", v);
+ if (v != "luminous" && v != "kraken" && v != "jewel" && v != "infernalis" &&
+ v != "hammer" && v != "giant" && v != "firefly" && v != "emperor" &&
+ v != "dumpling" && v != "cuttlefish" && v != "bobtail" && v != "argonaut") {
+ ss << "version " << v << " is not recognized";
+ err = -EINVAL;
+ goto reply;
+ }
+ OSDMap newmap;
+ newmap.deepish_copy_from(osdmap);
+ newmap.apply_incremental(pending_inc);
+ newmap.require_min_compat_client = v;
+ auto mv = newmap.get_min_compat_client();
+ if (v < mv.first) {
+ ss << "osdmap current utilizes features that require " << mv
+ << "; cannot set require_min_compat_client below that to " << v;
+ err = -EPERM;
+ goto reply;
+ }
+ ss << "set require_min_compat_client to " << v;
+ pending_inc.new_require_min_compat_client = v;
+ getline(ss, rs);
+ wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
+ get_last_committed() + 1));
+ return true;
} else if (prefix == "osd pause") {
return prepare_set_flag(op, CEPH_OSDMAP_PAUSERD | CEPH_OSDMAP_PAUSEWR);