From: myoungwon oh Date: Sun, 9 Aug 2020 11:35:23 +0000 (+0900) Subject: osd: remove existing object before rename is called X-Git-Tag: v16.1.0~1248^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90406672bc1dba582d0ef596087cba99c72401bb;p=ceph.git osd: remove existing object before rename is called In redirected manifest case, the object exists in the upper tier. So, to avoid a conflict when rename() is called, remove existing object first. Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 82c9c420aa68..82afb620305f 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -9426,6 +9426,13 @@ void PrimaryLogPG::process_copy_chunk(hobject_t oid, ceph_tid_t tid, int r) } else { // finish writing to temp object, then move into place dout(20) << "fill_in_final_tx: writing to temp object" << dendl; + if (obs.oi.has_manifest() && obs.oi.manifest.is_redirect() && obs.exists) { + /* In redirect manifest case, the object exists in the upper tier. + * So, to avoid a conflict when rename() is called, remove existing + * object first + */ + t->remove(obs.oi.soid); + } _write_copy_chunk(cop, t); t->rename(obs.oi.soid, cop->results.temp_oid); }