]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: make 'osd crush rm ...' slightly more idempotent
authorSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 04:09:09 +0000 (21:09 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 19:24:19 +0000 (12:24 -0700)
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 <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/mon/OSDMonitor.cc

index a00dc21eea161a63098e72f4637b6bdd73ebd906..7ee57907c4f61679a6904c03ca7a6e0db77c6b1b 100644 (file)
@@ -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;