From 308e2ef5c107bf04d3c5623f3c6bdffa10cf8c21 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 12 May 2014 15:08:07 -0700 Subject: [PATCH] ReplicatedPG::start_flush: send delete even if there are no snaps Even if all snaps for the clone have been removed, we still have to send the delete to ensure that when the object is recreated the new snaps aren't included in the wrong clone. Signed-off-by: Samuel Just (cherry picked from commit 2ec2182745fa7c22526a7cf3dedb25bc314c9db4) --- src/osd/ReplicatedPG.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b724d030425c8..6a471c95b040a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6171,6 +6171,7 @@ int ReplicatedPG::start_flush( // construct a SnapContext appropriate for this clone/head SnapContext dsnapc; + dsnapc.seq = 0; SnapContext snapc; if (soid.snap == CEPH_NOSNAP) { snapc.seq = snapset.seq; @@ -6213,7 +6214,7 @@ int ReplicatedPG::start_flush( object_locator_t base_oloc(soid); base_oloc.pool = pool.info.tier_of; - if (!dsnapc.snaps.empty()) { + if (dsnapc.seq > 0) { ObjectOperation o; o.remove(); osd->objecter_lock.Lock(); -- 2.39.5