]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: requeue ops when PG is no longer laggy
authorSage Weil <sage@redhat.com>
Tue, 23 Jul 2019 16:22:23 +0000 (11:22 -0500)
committerSage Weil <sage@redhat.com>
Thu, 26 Sep 2019 17:21:53 +0000 (12:21 -0500)
When we get a lease_ack, leave the laggy state.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PeeringState.cc
src/osd/PeeringState.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 4e511d6a4066272664588eff3ec7ebf08c928f65..e62aaa7139b6edad02ef1b45c4941569f0a00235 100644 (file)
@@ -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();
+    }
   }
 }
 
index d486507c2aca97b70cc591929a98c9a38a52b271..9c67ec52377d872ebdd418e4b1c29d906c9a4a0f 100644 (file)
@@ -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 ==================
     /**
index a048b43588a561673036d0f778800e3540dccb95..21b0f4cfff3983093eb11eecf88c6d0addd954dd 100644 (file)
@@ -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;
index 9b68c11235299415f779ab218f2dc582ef83b033..17ea9fdb920b1d80e4838faec2a2f9f8bb16942f 100644 (file)
@@ -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);