From: Sage Weil Date: Thu, 8 Feb 2018 14:51:23 +0000 (-0600) Subject: osd/PG: drop scrub machinery to wait for last_updated_applied X-Git-Tag: v13.0.2~222^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c489112a1dbcbb63024ba9c8c0abff6ef0c815d8;p=ceph.git osd/PG: drop scrub machinery to wait for last_updated_applied This is no longer needed--queued writes are immediately readable. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index fe8e0e44121c..16c7d1b52ad5 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4375,12 +4375,6 @@ void PG::replica_scrub( } 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; @@ -4523,11 +4517,6 @@ void PG::scrub(epoch_t queued, ThreadPool::TPHandle &handle) * | | | * _________v__________ | | * | | | | - * | WAIT_LAST_UPDATE | | | - * |____________________| | | - * | | | - * _________v__________ | | - * | | | | * | BUILD_MAP | | | * |____________________| | | * | | | @@ -4727,8 +4716,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) } } - // 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 @@ -4748,29 +4736,16 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) 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; @@ -4825,7 +4800,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) break; case PG::Scrubber::COMPARE_MAPS: - assert(last_update_applied >= scrubber.subset_last_update); assert(scrubber.waiting_on_whom.empty()); scrub_compare_maps(); @@ -5787,8 +5761,6 @@ ostream& operator<<(ostream& out, const PG& pg) 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) diff --git a/src/osd/PG.h b/src/osd/PG.h index 8f75e980b21b..8a664c9607e0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1484,7 +1484,6 @@ public: INACTIVE, NEW_CHUNK, WAIT_PUSHES, - WAIT_LAST_UPDATE, BUILD_MAP, BUILD_MAP_DONE, WAIT_REPLICAS, @@ -1521,7 +1520,6 @@ public: 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; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index b6a96724efcf..09bfafc3fbdc 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -9918,31 +9918,6 @@ void PrimaryLogPG::op_applied(const eversion_t &applied_version) 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( - scrubber.active_rep_scrub->get_req())->scrub_to) { - auto& op = scrubber.active_rep_scrub; - osd->enqueue_back( - OpQueueItem( - unique_ptr(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) @@ -12856,11 +12831,7 @@ void PrimaryLogPG::update_range( 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); }