From: Sage Weil Date: Tue, 23 Jul 2019 16:22:23 +0000 (-0500) Subject: osd: requeue ops when PG is no longer laggy X-Git-Tag: v15.1.0~1379^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3bb8a7210a647ae0f074277d5c2a73f2719741e7;p=ceph.git osd: requeue ops when PG is no longer laggy When we get a lease_ack, leave the laggy state. Signed-off-by: Sage Weil --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 4e511d6a4066..e62aaa7139b6 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -1155,10 +1155,11 @@ void PeeringState::proc_lease_ack(int from, const pg_lease_ack_t& a) } } if (was_min) { + auto old_ru = readable_until; recalc_readable_until(); -// if (pl->is_laggy() && readable_until > now) { -#warning fixme: wake up? - //} + if (now < old_ru) { + pl->recheck_readable(); + } } } diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index d486507c2aca..9c67ec52377d 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -273,6 +273,7 @@ public: virtual ceph::signedspan get_mnow() = 0; virtual HeartbeatStampsRef get_hb_stamps(int peer) = 0; virtual void schedule_renew_lease(epoch_t plr, ceph::timespan delay) = 0; + virtual void recheck_readable() = 0; // ============ Flush state ================== /** diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index a048b43588a5..21b0f4cfff39 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -786,6 +786,21 @@ bool PrimaryLogPG::check_laggy_requeue(OpRequestRef& op) return false; } +void PrimaryLogPG::recheck_readable() +{ + if (is_laggy()) { + auto ru = recovery_state.get_readable_until(); + auto mnow = osd->get_mnow(); + if (ru > mnow) { + dout(10) << __func__ << " no longer laggy (ru " << ru << " > mnow " << mnow + << ")" << dendl; + state_clear(PG_STATE_LAGGY); + publish_stats_to_osd(); + requeue_ops(waiting_for_readable); + } + } +} + bool PrimaryLogPG::pgls_filter(const PGLSFilter& filter, const hobject_t& sobj) { bufferlist bl; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 9b68c1123529..17ea9fdb920b 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1875,6 +1875,7 @@ public: bool check_laggy(OpRequestRef& op); bool check_laggy_requeue(OpRequestRef& op); + void recheck_readable() override; bool is_backfill_target(pg_shard_t osd) const { return recovery_state.is_backfill_target(osd);