From: hansbogert Date: Sun, 19 Nov 2017 17:28:06 +0000 (+0100) Subject: mon: Add `ceph osd get-require-min-compat-client` command X-Git-Tag: v13.0.2~133^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=364559074ef814f04a6105cbf87ecfe096b8f403;p=ceph.git mon: Add `ceph osd get-require-min-compat-client` command As an antagonist to the already existing `set-require-min-compat-client` Signed-off-by: hansbogert --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 2f01b64ba095..5bb39ba5f43c 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1410,6 +1410,7 @@ function test_mon_osd() # 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 get-require-min-compat-client | grep luminous ceph osd dump | grep 'require_min_compat_client luminous' # diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 0f1729d4f9a2..0f3002fab872 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -709,6 +709,9 @@ COMMAND("osd set-nearfull-ratio " \ "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 get-require-min-compat-client", + "get the minimum client version we will maintain compatibility with", + "osd", "r", "cli,rest") COMMAND("osd set-require-min-compat-client " \ "name=version,type=CephString " \ "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a74191aabf33..ece3f32f4793 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4940,6 +4940,11 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op) rdata.append(ss.str()); ss.str(""); } + } else if (prefix == "osd get-require-min-compat-client") { + ss << ceph_release_name(osdmap.require_min_compat_client) << std::endl; + rdata.append(ss.str()); + ss.str(""); + goto reply; } else { // try prepare update return false;