From 47852c263831707fff1570317a7446b0700c5962 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Jul 2013 21:55:51 -0700 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 2751656a8225a..9c854cda86ed6 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) { -- 2.39.5