]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ReplicatedPG: Fix bug in rollback
authorSamuel Just <samuelj@hq.newdream.net>
Mon, 10 Jan 2011 22:45:06 +0000 (14:45 -0800)
committerSamuel Just <samuelj@hq.newdream.net>
Mon, 10 Jan 2011 23:41:09 +0000 (15:41 -0800)
commite189222f06ee287eeb6fd7f46cff7a6727806dea
treed4d25ee791307ba5459b8555209d6ba80a4af797
parent630565f3ac96c3f4f5eb2d54fc76086695ab18cc
ReplicatedPG: Fix bug in rollback

Previously, _rollback_to assumed that the rollback was a noop if
ctx->clone_obc was set and it's prior version matches head's version.
However, this broke in sequences like:

Write "snap1 contents" to oid "blah"
create snapshot "snap1"
Write "snap2 contents" to oid "blah"
create snapshot "snap2"
rollback oid "blah" to snapshot "snap1"

In this case, make_writeable would have just cloned head to the snap2
clone, but the relevant clone is actually "snap1".  _rollback_to now
verifies that the most recent clone is the correct one before assuming
that head is already correct.

Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
src/osd/ReplicatedPG.cc