From a8f85dccbb37bca09e4cc7b4e00239a6d674259c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 10 Dec 2014 21:00:26 -0800 Subject: [PATCH] mon: allow full flag to be manually cleared This is like a temporary measure as the mon will try to set them again, but we have run into cases where the mon was misbehaving (failing to clear the flag) and we wanted to do it. Note that the mon will likely set it again on the next tick() anyway. If we're going to clear it, we may as well be able to set it, too (again, even if the mon is going to clear it soon). If nothing else this is useful for writing tests. Fixes: #9323 Signed-off-by: Sage Weil --- qa/workunits/cephtool/test.sh | 2 +- src/mon/MonCommands.h | 4 ++-- src/mon/OSDMonitor.cc | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index b333984bcee..cfc272eeac1 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -843,7 +843,7 @@ function test_mon_osd() ceph osd deep-scrub 0 ceph osd repair 0 - for f in noup nodown noin noout noscrub nodeep-scrub nobackfill norecover notieragent + for f in noup nodown noin noout noscrub nodeep-scrub nobackfill norecover notieragent full do ceph osd set $f ceph osd unset $f diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index a2e5d4b7ba4..2dc8c949068 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -500,10 +500,10 @@ COMMAND("osd erasure-code-profile ls", \ "list all erasure code profiles", \ "osd", "r", "cli,rest") COMMAND("osd set " \ - "name=key,type=CephChoices,strings=pause|noup|nodown|noout|noin|nobackfill|norecover|noscrub|nodeep-scrub|notieragent", \ + "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norecover|noscrub|nodeep-scrub|notieragent", \ "set ", "osd", "rw", "cli,rest") COMMAND("osd unset " \ - "name=key,type=CephChoices,strings=pause|noup|nodown|noout|noin|nobackfill|norecover|noscrub|nodeep-scrub|notieragent", \ + "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norecover|noscrub|nodeep-scrub|notieragent", \ "unset ", "osd", "rw", "cli,rest") COMMAND("osd cluster_snap", "take cluster snapshot (disabled)", \ "osd", "r", "") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ba0298809c3..67066e6c180 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4792,7 +4792,9 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m, } else if (prefix == "osd set") { string key; cmd_getval(g_ceph_context, cmdmap, "key", key); - if (key == "pause") + if (key == "full") + return prepare_set_flag(m, CEPH_OSDMAP_FULL); + else if (key == "pause") return prepare_set_flag(m, CEPH_OSDMAP_PAUSERD | CEPH_OSDMAP_PAUSEWR); else if (key == "noup") return prepare_set_flag(m, CEPH_OSDMAP_NOUP); @@ -4820,7 +4822,9 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m, } else if (prefix == "osd unset") { string key; cmd_getval(g_ceph_context, cmdmap, "key", key); - if (key == "pause") + if (key == "full") + return prepare_unset_flag(m, CEPH_OSDMAP_FULL); + else if (key == "pause") return prepare_unset_flag(m, CEPH_OSDMAP_PAUSERD | CEPH_OSDMAP_PAUSEWR); else if (key == "noup") return prepare_unset_flag(m, CEPH_OSDMAP_NOUP);