mirror of
https://github.com/ceph/ceph
synced 2025-02-19 17:08:05 +00:00
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 <sam.just@inktank.com>
This commit is contained in:
parent
f2384412cf
commit
eb8f66d5d8
@ -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<CopyFromCallback*>(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;
|
||||
|
Loading…
Reference in New Issue
Block a user