]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ReplicatedPG: start_flush: use filtered snapset
authorSamuel Just <sjust@redhat.com>
Wed, 27 May 2015 18:00:54 +0000 (11:00 -0700)
committerAbhishek Lekshmanan <abhishek.lekshmanan@ril.com>
Mon, 8 Jun 2015 17:30:16 +0000 (23:00 +0530)
commita1161540bc0094a951021d4ca651b95ec045213e
tree1faf0b970d20c6ab310f12a91d5c1cdb3ea17dfc
parentd967cecf0a5d7fbf992a0195341cbd893a358264
ReplicatedPG: start_flush: use filtered snapset

Otherwise, we might send our deletes based on deleted snaps.  This is
problematic since we may have trimmed the clones to which those snaps
belong, causing us to send them at an earlier snap than we used before.

The specific situation was

78:[78, 70, 63, 5a, 58, 57]:[64(63), 58(58, 57)]

with 58 already clean.  To flush 64, we send:

delete@58
delete@59
copyfrom@62

Then, snap 63 is trimmed leaving us with a snapset of:

78:[78, 70, 63, 5a, 58, 57]:[58(58, 57)]

since trim_object doesn't filter the head object snapset snaps.  This
isn't really a bug since in general all snapset users must be aware
that there may be trimmed snaps in snapset::snaps.  However, here
it becomes a problem when we go to flush head:

delete@58 -- ignored due to snapc
delete@59 -- ignored due to snapc
copyfrom@78 -- not ignored

The base pool head is at snap seq 62, so it clones that value into
clone 78(78, 70) instead of forgetting it.  What should have happened
is that we should have based our flushes on filtered snapset:

78:[78, 70, 58, 57]:[58(58, 57)]

Causing us to instead send:

delete@58 -- ignored due to snapc
delete@69 -- not ignored, causes no clone to be made
copyfrom@78 -- not ignored, updates head such that a subsequent clone
will leave 70 out of the clone snaps vector.

Fixes: 11787
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 6051e255ac062985ada1989edb7f23cd750915e2)
src/osd/ReplicatedPG.cc
src/osd/osd_types.cc
src/osd/osd_types.h