]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: clean up temp object if copy-from fails 8487/head
authorSage Weil <sage@redhat.com>
Thu, 7 Apr 2016 15:41:55 +0000 (11:41 -0400)
committerSage Weil <sage@redhat.com>
Thu, 7 Apr 2016 15:49:08 +0000 (11:49 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index 3958f8942ea579e02a9fd291e387325e16cf6bb6..7dff8a13ca2d177fb0b66eb6a51d8a534656ddca 100644 (file)
@@ -7330,6 +7330,16 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, ceph_tid_t tid, int r)
   copy_ops.erase(cobc->obs.oi.soid);
   cobc->stop_block();
 
+  if (r < 0 && cop->results.started_temp_obj) {
+    dout(10) << __func__ << " deleting partial temp object "
+            << cop->results.temp_oid << dendl;
+    ObjectContextRef tempobc = get_object_context(cop->results.temp_oid, true);
+    OpContextUPtr ctx = simple_opc_create(tempobc);
+    ctx->op_t->remove(cop->results.temp_oid);
+    ctx->discard_temp_oid = cop->results.temp_oid;
+    simple_opc_submit(std::move(ctx));
+  }
+
   // cancel and requeue proxy ops on this object
   if (!r) {
     for (map<ceph_tid_t, ProxyReadOpRef>::iterator it = proxyread_ops.begin();