From: Sage Weil Date: Tue, 9 Jul 2013 04:09:09 +0000 (-0700) Subject: mon/OSDMonitor: make 'osd crush rm ...' slightly more idempotent X-Git-Tag: v0.67-rc1~132 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18a624fd8b90d9959de51f07622cf0839e6bd9aa;p=ceph.git mon/OSDMonitor: make 'osd crush rm ...' slightly more idempotent This particular failure is easily triggered by the crush_ops.sh workunit. Make it a bit less likely to fail. Signed-off-by: Sage Weil Reviewed-by: Joao Eduardo Luis --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a00dc21eea16..7ee57907c4f6 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2712,11 +2712,18 @@ bool OSDMonitor::prepare_command(MMonCommand *m) string name; cmd_getval(g_ceph_context, cmdmap, "name", name); - if (!newcrush.name_exists(name)) { + if (!osdmap.crush->name_exists(name)) { err = 0; ss << "device '" << name << "' does not appear in the crush map"; break; } + if (!newcrush.name_exists(name)) { + err = 0; + ss << "device '" << name << "' does not appear in the crush map"; + getline(ss, rs); + wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, rs, get_last_committed())); + return true; + } int id = newcrush.get_item_id(name); bool unlink_only = prefix == "osd crush unlink"; string ancestor_str;