]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not include snaps with head on list_snaps()
authorSage Weil <sage@inktank.com>
Tue, 26 Mar 2013 04:18:47 +0000 (21:18 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 1 Apr 2013 06:32:40 +0000 (23:32 -0700)
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 <sage@inktank.com>
src/osd/ReplicatedPG.cc

index 1c2a97fc98f6225dc77d1398b18bf2b155ed174d..57be884b28d1a2edb7b4c70c294c607201bfb046 100644 (file)
@@ -2333,10 +2333,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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;