Skip to content

Commit

Permalink
Merge pull request ceph#26996 from neha-ojha/wip-2-36739
Browse files Browse the repository at this point in the history
osd/PG: skip rollforward when !transaction_applied during append_log()

Reviewed-by: Xie Xingguo <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
neha-ojha authored Mar 19, 2019
2 parents ec6cf3a + 71996da commit e2c953a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3887,11 +3887,16 @@ void PG::append_log(

PGLogEntryHandler handler{this, &t};
if (!transaction_applied) {
/* We must be a backfill peer, so it's ok if we apply
/* We must be a backfill or async recovery peer, so it's ok if we apply
* out-of-turn since we won't be considered when
* determining a min possible last_update.
*
* We skip_rollforward() here, which advances the crt, without
* doing an actual rollforward. This avoids cleaning up entries
* from the backend and we do not end up in a situation, where the
* object is deleted before we can _merge_object_divergent_entries().
*/
pg_log.roll_forward(&handler);
pg_log.skip_rollforward();
}

for (vector<pg_log_entry_t>::const_iterator p = logv.begin();
Expand Down Expand Up @@ -4647,12 +4652,12 @@ void PG::_scan_rollback_obs(const vector<ghobject_t> &rollback_obs)
i != rollback_obs.end();
++i) {
if (i->generation < trimmed_to.version) {
osd->clog->error() << "osd." << osd->whoami
<< " pg " << info.pgid
<< " found obsolete rollback obj "
<< *i << " generation < trimmed_to "
<< trimmed_to
<< "...repaired";
dout(10) << __func__ << "osd." << osd->whoami
<< " pg " << info.pgid
<< " found obsolete rollback obj "
<< *i << " generation < trimmed_to "
<< trimmed_to
<< "...repaired" << dendl;
t.remove(coll, *i);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/osd/PGLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ struct PGLog : DoutPrefixProvider {
h);
}

void skip_rollforward() {
log.skip_can_rollback_to_to_head();
}

//////////////////// get or set log & missing ////////////////////

void reset_backfill_claim_log(const pg_log_t &o, LogEntryHandler *h) {
Expand Down

0 comments on commit e2c953a

Please sign in to comment.