From: Samuel Just Date: Fri, 16 May 2014 23:56:33 +0000 (-0700) Subject: ReplicatedPG::start_flush: fix clone deletion case X-Git-Tag: v0.82~59^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1832%2Fhead;p=ceph.git ReplicatedPG::start_flush: fix clone deletion case dsnapc.snaps will be non-empty most of the time if there have been snaps before prev_snapc. What we really want to know is whether there are any snaps between oi.snaps.back() and prev_snapc. Fixes: 8334 Backport: firefly Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4c69111fa922..3b89b4ff0a35 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6203,14 +6203,20 @@ int ReplicatedPG::start_flush( ++p; snapc.snaps = vector(p, snapset.snaps.end()); + while (p != snapset.snaps.end() && *p >= oi.snaps.back()) + ++p; + vector::iterator dnewest = p; + // we may need to send a delete first while (p != snapset.snaps.end() && *p > prev_snapc) ++p; dsnapc.snaps = vector(p, snapset.snaps.end()); - if (dsnapc.snaps.empty()) { + if (p == dnewest) { + // no snaps between the oldest in this clone and prev_snapc snapc.seq = prev_snapc; } else { + // snaps between oldest in this clone and prev_snapc, send delete dsnapc.seq = prev_snapc; snapc.seq = oi.snaps.back() - 1; }