]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: remove existing object before rename is called
authormyoungwon oh <ohmyoungwon@gmail.com>
Sun, 9 Aug 2020 11:35:23 +0000 (20:35 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Tue, 18 Aug 2020 16:38:56 +0000 (01:38 +0900)
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 <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc

index 82c9c420aa6825f68d07a27d29c9af583b3e2637..82afb620305fb7e688bcd23a098fdbaa1f43b572 100644 (file)
@@ -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);
       }