From: Sage Weil Date: Tue, 26 Mar 2013 04:18:47 +0000 (-0700) Subject: osd: do not include snaps with head on list_snaps() X-Git-Tag: v0.62~118^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b64bb5f8608c87f4c1e7eb10e87a563c7c88831d;p=ceph.git osd: do not include snaps with head on list_snaps() If there is a sequence of snaps 1, 2, 3, 4, 5, and we have a clone 2 with [1,2], and the head reflects content at snap times [3,4,5], then the snap_list should return clone 2 snaps [1,2] head snaps seq 2 because it never saw a write after snap 2, and therefor has the same content currently as it did in snaps 3,4,5. If the SnapSet on the object lists snaps 3,4,5, and the head exists, it actually means the object was deleted between 2 and 3, and was recreated after 5: clone 2 snaps [1,2] head snaps [] seq 5 The key to telling the two situations apart is the seq number on the SnapSet (now included in the list_snaps reply) that tells us when the last update was. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1c2a97fc98f6..57be884b28d1 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2333,10 +2333,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) clone_info ci; ci.cloneid = clone_info::HEAD; - //Put remaining snapshots into head clone - for ( ; snap_iter != ssc->snapset.snaps.rend(); ++snap_iter) - ci.snaps.push_back(*snap_iter); - //Size for HEAD is oi.size ci.size = oi.size;