From b64bb5f8608c87f4c1e7eb10e87a563c7c88831d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 25 Mar 2013 21:18:47 -0700 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1c2a97fc98f62..57be884b28d1a 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; -- 2.39.5