]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: fail osd_command if OSD is down
authorDan Mick <dan.mick@inktank.com>
Mon, 10 Jun 2013 22:03:37 +0000 (15:03 -0700)
committerDan Mick <dan.mick@inktank.com>
Tue, 11 Jun 2013 00:06:04 +0000 (17:06 -0700)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 7a4d1dbbd48368a06abdf3129ecbf472841b123d..59c859b64b11770d63d037031350c4b911dce9fc 100644 (file)
@@ -2346,10 +2346,11 @@ int Objecter::_submit_command(CommandOp *c, tid_t *ptid)
   command_ops[tid] = c;
   num_homeless_ops++;
   int r = recalc_command_target(c);
-  if (r == RECALC_OP_TARGET_OSD_DNE) {
-    // XXX take back tid incr? 
+  if (r == RECALC_OP_TARGET_OSD_DNE)
+    return -ENOENT;
+  if (r == RECALC_OP_TARGET_OSD_DOWN)
     return -ENXIO;
-  }
+
   if (c->session)
     _send_command(c);
   else
@@ -2366,6 +2367,8 @@ int Objecter::recalc_command_target(CommandOp *c)
   if (c->target_osd >= 0) {
     if (!osdmap->exists(c->target_osd))
       return RECALC_OP_TARGET_OSD_DNE;
+    if (osdmap->is_down(c->target_osd))
+      return RECALC_OP_TARGET_OSD_DOWN;
     s = get_session(c->target_osd);
   } else {
     if (!osdmap->have_pg_pool(c->target_pg.pool()))
index 183d8d1900f705ebc82d3d8b23426430ce835719..acedef3ed4d56aab29e5c0a95634a8e81289579b 100644 (file)
@@ -1094,6 +1094,7 @@ public:
     RECALC_OP_TARGET_NEED_RESEND,
     RECALC_OP_TARGET_POOL_DNE,
     RECALC_OP_TARGET_OSD_DNE,
+    RECALC_OP_TARGET_OSD_DOWN,
   };
   int recalc_op_target(Op *op);
   bool recalc_linger_op_target(LingerOp *op);