Skip to content

Commit

Permalink
Merge pull request #5121: FAILED assert(!old_value.deleted()) in upgr…
Browse files Browse the repository at this point in the history
…ade:giant-x-hammer-distro-basic-multi run

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
ldachary committed Jul 19, 2015
2 parents 1e0f329 + 7034720 commit a603f9e
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -6529,6 +6529,35 @@ void ReplicatedPG::finish_promote(int r, CopyResults *results,
return;
}

if (r != -ENOENT && soid.is_snap()) {
if (results->snaps.empty()) {
// we must have read "snap" content from the head object in
// the base pool. use snap_seq to construct what snaps should
// be for this clone (what is was before we evicted the clean
// clone from this pool, and what it will be when we flush and
// the clone eventually happens in the base pool).
SnapSet& snapset = obc->ssc->snapset;
vector<snapid_t>::iterator p = snapset.snaps.begin();
while (p != snapset.snaps.end() && *p > soid.snap)
++p;
while (p != snapset.snaps.end() && *p > results->snap_seq) {
results->snaps.push_back(*p);
++p;
}
}

dout(20) << __func__ << " snaps " << results->snaps << dendl;
filter_snapc(results->snaps);

dout(20) << __func__ << " filtered snaps " << results->snaps << dendl;
if (results->snaps.empty()) {
dout(20) << __func__
<< " snaps are empty, clone is invalid,"
<< " setting r to ENOENT" << dendl;
r = -ENOENT;
}
}

if (r == -ENOENT && results->started_temp_obj) {
dout(10) << __func__ << " abort; will clean up partial work" << dendl;
ObjectContextRef tempobc = get_object_context(results->temp_oid, true);
Expand Down Expand Up @@ -6633,25 +6662,7 @@ void ReplicatedPG::finish_promote(int r, CopyResults *results,
tctx->new_obs.oi.user_version = results->user_version;

if (soid.snap != CEPH_NOSNAP) {
if (!results->snaps.empty()) {
tctx->new_obs.oi.snaps = results->snaps;
} else {
// we must have read "snap" content from the head object in
// the base pool. use snap_seq to construct what snaps should
// be for this clone (what is was before we evicted the clean
// clone from this pool, and what it will be when we flush and
// the clone eventually happens in the base pool).
SnapSet& snapset = obc->ssc->snapset;
vector<snapid_t>::iterator p = snapset.snaps.begin();
while (p != snapset.snaps.end() && *p > soid.snap)
++p;
assert(p != snapset.snaps.end());
do {
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;
tctx->new_obs.oi.snaps = results->snaps;
assert(!tctx->new_obs.oi.snaps.empty());
assert(obc->ssc->snapset.clone_size.count(soid.snap));
assert(obc->ssc->snapset.clone_size[soid.snap] ==
Expand Down

0 comments on commit a603f9e

Please sign in to comment.