From: Sage Weil Date: Thu, 11 Dec 2014 05:00:26 +0000 (-0800) Subject: mon: allow full flag to be manually cleared X-Git-Tag: v0.91~55^2~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a8f85dccbb37bca09e4cc7b4e00239a6d674259c;p=ceph.git 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 --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index b333984bcee8..cfc272eeac15 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 a2e5d4b7ba44..2dc8c9490683 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 ba0298809c35..67066e6c1808 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);