summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-09 21:55:51 -0700
committerSage Weil <sage@inktank.com>2013-07-09 21:55:51 -0700
commit47852c263831707fff1570317a7446b0700c5962 (patch)
tree5261827b93e7c6598b334b8f7fe9d17217b31fc2
parentbfc26c656d183fbcc90a352391e47f9f51c96052 (diff)
downloadceph-47852c263831707fff1570317a7446b0700c5962.tar.gz
mon/OSDMonitor: make 'osd crush rm ...' slightly more idempotent
This is a manual backport of 18a624fd8b90d9959de51f07622cf0839e6bd9aa. Do not return immediately if we are looking at uncommitted state.t Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 2751656a822..9c854cda86e 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -2761,11 +2761,17 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
CrushWrapper newcrush;
_get_pending_crush(newcrush);
- if (!newcrush.name_exists(m->cmd[3].c_str())) {
+ if (!osdmap.crush->name_exists(m->cmd[3].c_str())) {
err = 0;
ss << "device '" << m->cmd[3] << "' does not appear in the crush map";
break;
}
+ if (!newcrush.name_exists(m->cmd[3].c_str())) {
+ ss << "device '" << m->cmd[3] << "' does not appear in the crush map";
+ getline(ss, rs);
+ wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, rs, get_version()));
+ return true;
+ }
int id = newcrush.get_item_id(m->cmd[3].c_str());
bool unlink_only = m->cmd[2] == "unlink";
if (m->cmd.size() > 4) {