]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
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)
commitb64bb5f8608c87f4c1e7eb10e87a563c7c88831d
tree2cbff1e23e528980ddb546637cd7b4e8c177b37b
parent01b74209fbe732e2d8e48395a426208354b97843
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 <sage@inktank.com>
src/osd/ReplicatedPG.cc