]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: allow full flag to be manually cleared 3146/head
authorSage Weil <sage@redhat.com>
Thu, 11 Dec 2014 05:00:26 +0000 (21:00 -0800)
committerSage Weil <sage@redhat.com>
Thu, 11 Dec 2014 05:00:26 +0000 (21:00 -0800)
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 <sage@redhat.com>
qa/workunits/cephtool/test.sh
src/mon/MonCommands.h
src/mon/OSDMonitor.cc

index b333984bcee81c3f4437ff9f66a44b2ea58a6925..cfc272eeac15b99545cc05527745556aebf97d7d 100755 (executable)
@@ -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
index a2e5d4b7ba44e2c2bc3cd3e5abf1e1d7256a5ce3..2dc8c9490683cc472e48b0b596f25047dc87f150 100644 (file)
@@ -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 <key>", "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 <key>", "osd", "rw", "cli,rest")
 COMMAND("osd cluster_snap", "take cluster snapshot (disabled)", \
        "osd", "r", "")
index ba0298809c3540e1b3cadc2227730a476685a33e..67066e6c180890ab6dae16458ec69d676ad1fc73 100644 (file)
@@ -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);