Skip to content

Commit

Permalink
ReplicatedPG::finish_promote: fix snap promote head snaps
Browse files Browse the repository at this point in the history
If the snaps vector is: 10=[9,5,2]:[4]+head, the backing pool's snaps
vector is 3=[2]:[]+head, and we request clone 4 from the backing pool,
the backing pool will send us head with an empty results->snaps vector.
Actually, clone 4 should be trimmed, but the cache pool does not know
that.  Thus, we should construct an empty snaps vector for that clone.

PartialFix: #11296
Backport: firefly, hammer
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit a45a698)
  • Loading branch information
athanatos authored and theanalyst committed Jul 1, 2015
1 parent 72ecd52 commit 3e44dc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -6642,11 +6642,10 @@ void ReplicatedPG::finish_promote(int r, CopyResults *results,
vector<snapid_t>::iterator p = snapset.snaps.begin();
while (p != snapset.snaps.end() && *p > soid.snap)
++p;
assert(p != snapset.snaps.end());
do {
while (p != snapset.snaps.end() && *p > results->snap_seq) {
tctx->new_obs.oi.snaps.push_back(*p);
++p;
} while (p != snapset.snaps.end() && *p > results->snap_seq);
}
}
dout(20) << __func__ << " snaps " << tctx->new_obs.oi.snaps << dendl;
assert(!tctx->new_obs.oi.snaps.empty());
Expand Down

0 comments on commit 3e44dc1

Please sign in to comment.