}
assert(msg->chunky);
- if (last_update_applied < msg->scrub_to) {
- dout(10) << "waiting for last_update_applied to catch up" << dendl;
- scrubber.active_rep_scrub = op;
- return;
- }
-
if (active_pushes > 0) {
dout(10) << "waiting for active pushes to finish" << dendl;
scrubber.active_rep_scrub = op;
* | | |
* _________v__________ | |
* | | | |
- * | WAIT_LAST_UPDATE | | |
- * |____________________| | |
- * | | |
- * _________v__________ | |
- * | | | |
* | BUILD_MAP | | |
* |____________________| | |
* | | |
}
}
- // ask replicas to wait until
- // last_update_applied >= scrubber.subset_last_update and then scan
+ // ask replicas to scan
scrubber.waiting_on_whom.insert(pg_whoami);
// request maps from replicas
break;
case PG::Scrubber::WAIT_PUSHES:
- if (active_pushes == 0) {
- scrubber.state = PG::Scrubber::WAIT_LAST_UPDATE;
- } else {
+ if (active_pushes > 0) {
dout(15) << "wait for pushes to apply" << dendl;
done = true;
- }
- break;
-
- case PG::Scrubber::WAIT_LAST_UPDATE:
- if (last_update_applied < scrubber.subset_last_update) {
- // will be requeued by op_applied
- dout(15) << "wait for writes to flush" << dendl;
- done = true;
break;
}
-
- scrubber.state = PG::Scrubber::BUILD_MAP;
scrubber.primary_scrubmap_pos.reset();
+ scrubber.state = PG::Scrubber::BUILD_MAP;
break;
case PG::Scrubber::BUILD_MAP:
- assert(last_update_applied >= scrubber.subset_last_update);
-
// build my own scrub map
if (scrub_preempted) {
dout(10) << __func__ << " preempted" << dendl;
break;
case PG::Scrubber::COMPARE_MAPS:
- assert(last_update_applied >= scrubber.subset_last_update);
assert(scrubber.waiting_on_whom.empty());
scrub_compare_maps();
if (pg.is_peered()) {
if (pg.last_update_ondisk != pg.info.last_update)
out << " luod=" << pg.last_update_ondisk;
- if (pg.last_update_applied != pg.info.last_update)
- out << " lua=" << pg.last_update_applied;
}
if (pg.recovery_ops_active)
INACTIVE,
NEW_CHUNK,
WAIT_PUSHES,
- WAIT_LAST_UPDATE,
BUILD_MAP,
BUILD_MAP_DONE,
WAIT_REPLICAS,
case INACTIVE: ret = "INACTIVE"; break;
case NEW_CHUNK: ret = "NEW_CHUNK"; break;
case WAIT_PUSHES: ret = "WAIT_PUSHES"; break;
- case WAIT_LAST_UPDATE: ret = "WAIT_LAST_UPDATE"; break;
case BUILD_MAP: ret = "BUILD_MAP"; break;
case BUILD_MAP_DONE: ret = "BUILD_MAP_DONE"; break;
case WAIT_REPLICAS: ret = "WAIT_REPLICAS"; break;
dout(10) << "op_applied version " << applied_version << dendl;
assert(applied_version == info.last_update);
last_update_applied = applied_version;
- if (is_primary()) {
- if (scrubber.active) {
- if (last_update_applied >= scrubber.subset_last_update) {
- requeue_scrub(ops_blocked_by_scrub());
- }
- } else {
- assert(scrubber.start == scrubber.end);
- }
- } else {
- if (scrubber.active_rep_scrub) {
- if (last_update_applied >= static_cast<const MOSDRepScrub*>(
- scrubber.active_rep_scrub->get_req())->scrub_to) {
- auto& op = scrubber.active_rep_scrub;
- osd->enqueue_back(
- OpQueueItem(
- unique_ptr<OpQueueItem::OpQueueable>(new PGOpItem(info.pgid, op)),
- op->get_req()->get_cost(),
- op->get_req()->get_priority(),
- op->get_req()->get_recv_stamp(),
- op->get_req()->get_source().num(),
- get_osdmap()->get_epoch()));
- scrubber.active_rep_scrub = OpRequestRef();
- }
- }
- }
}
void PrimaryLogPG::eval_repop(RepGather *repop)
if (bi->version < info.log_tail) {
dout(10) << __func__<< ": bi is old, rescanning local backfill_info"
<< dendl;
- if (last_update_applied >= info.log_tail) {
- bi->version = last_update_applied;
- } else {
- bi->version = info.last_update;
- }
+ bi->version = info.last_update;
scan_range(local_min, local_max, bi, handle);
}