]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: adjust flow in process_copy_chunk
authorSage Weil <sage@inktank.com>
Sun, 5 Jan 2014 09:04:16 +0000 (01:04 -0800)
committerSage Weil <sage@inktank.com>
Tue, 14 Jan 2014 00:19:48 +0000 (16:19 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc

index 0493e848ce1465c2b206a6c004ff28f18118c06e..64bb63a63e89072129b0ccaa8aa37df59f2b5f50 100644 (file)
@@ -4980,28 +4980,31 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r)
   cop->objecter_tid2 = 0;  // assume this ordered before us (if it happened)
   ObjectContextRef& cobc = cop->obc;
 
-  if (r >= 0) {
-    assert(cop->rval >= 0);
-
-    if (!cop->cursor.is_complete()) {
-      // write out what we have so far
-      ObjectContextRef tempobc = get_object_context(cop->temp_oid, true);
-      RepGather *repop = simple_repop_create(tempobc);
-      if (cop->temp_cursor.is_initial()) {
-       cop->temp_coll = get_temp_coll(&repop->ctx->local_t);
-       repop->ctx->new_temp_oid = cop->temp_oid;
-      }
-      _write_copy_chunk(cop, &repop->ctx->op_t);
-      simple_repop_submit(repop);
-
-      dout(10) << __func__ << " fetching more" << dendl;
-      _copy_some(cobc, cop);
-      return;
-    }
-    _build_finish_copy_transaction(cop, cop->results.final_tx);
+  if (r < 0)
+    goto out;
+
+  assert(cop->rval >= 0);
+
+  if (!cop->cursor.is_complete()) {
+    // write out what we have so far
+    ObjectContextRef tempobc = get_object_context(cop->temp_oid, true);
+    RepGather *repop = simple_repop_create(tempobc);
+    if (cop->temp_cursor.is_initial()) {
+      cop->temp_coll = get_temp_coll(&repop->ctx->local_t);
+      repop->ctx->new_temp_oid = cop->temp_oid;
+    }
+    _write_copy_chunk(cop, &repop->ctx->op_t);
+    simple_repop_submit(repop);
+    dout(10) << __func__ << " fetching more" << dendl;
+    _copy_some(cobc, cop);
+    return;
   }
 
-  dout(20) << __func__ << " complete; committing" << dendl;
+  dout(20) << __func__ << " success; committing" << dendl;
+  _build_finish_copy_transaction(cop, cop->results.final_tx);
+
+ out:
+  dout(20) << __func__ << " complete r = " << cpp_strerror(r) << dendl;
   CopyCallbackResults results(r, &cop->results);
   cop->cb->complete(results);