From: Samuel Just Date: Sat, 7 Dec 2013 22:52:49 +0000 (-0800) Subject: ReplicatedPG: handle removing the old object in finish_copy_op X-Git-Tag: v0.78~286^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eb8f66d5d8871d0ad02c8e51ac1c75fab3d05023;p=ceph.git ReplicatedPG: handle removing the old object in finish_copy_op do_osd_ops will need to either copy the old version out of the way or simply delete it depending on mod_desc. Thus, defer handling filling that part in until we finish the copy op. Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2472787c33a..4dc0ee4e8e9 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5411,11 +5411,6 @@ void ReplicatedPG::_build_finish_copy_transaction(CopyOpRef cop, PGBackend::PGTransaction* t) { ObjectState& obs = cop->obc->obs; - - if (obs.exists) { - t->remove(obs.oi.soid); - } - if (cop->temp_cursor.is_initial()) { // write directly to final object cop->results.temp_oid = obs.oi.soid; @@ -5433,6 +5428,10 @@ void ReplicatedPG::finish_copyfrom(OpContext *ctx) ObjectState& obs = ctx->new_obs; CopyFromCallback *cb = static_cast(ctx->copy_cb); + if (obs.exists) { + ctx->op_t->remove(obs.oi.soid); + } + if (!ctx->obs->exists) { ctx->delta_stats.num_objects++; obs.exists = true;