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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-12-10 21:00:26 -08:00
parent a1eb443ee5
commit a8f85dccbb
3 changed files with 9 additions and 5 deletions

View File

@ -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

View 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", "")

View 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);