]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: make 'osd crush rm ...' slightly more idempotent
authorSage Weil <sage@inktank.com>
Wed, 10 Jul 2013 04:55:51 +0000 (21:55 -0700)
committerSage Weil <sage@inktank.com>
Wed, 10 Jul 2013 04:55:51 +0000 (21:55 -0700)
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>
src/mon/OSDMonitor.cc

index 2751656a8225a7a358a2700f31e80b0945325244..9c854cda86ed6215c79f0f3cdfa39025a2195646 100644 (file)
@@ -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) {