]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fast dispatch backfill and recovery reservation events
authorSage Weil <sage@redhat.com>
Wed, 6 Dec 2017 03:34:58 +0000 (21:34 -0600)
committerSage Weil <sage@redhat.com>
Tue, 3 Apr 2018 15:12:35 +0000 (10:12 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 6320109080896a7541011c10396a3386f1f08488..d0b06a9d48bf8665d28a6ecfc7484e0f34bbe896 100644 (file)
 #include "messages/MOSDPGUpdateLogMissing.h"
 #include "messages/MOSDPGUpdateLogMissingReply.h"
 
+#include "messages/MOSDPeeringOp.h"
+
 #include "messages/MOSDAlive.h"
 
 #include "messages/MOSDScrub.h"
@@ -6548,6 +6550,19 @@ void OSD::ms_fast_dispatch(Message *m)
     m->put();
     return;
   }
+
+  // peering event?
+  switch (m->get_type()) {
+  case MSG_OSD_BACKFILL_RESERVE:
+  case MSG_OSD_RECOVERY_RESERVE:
+    {
+      MOSDPeeringOp *pm = static_cast<MOSDPeeringOp*>(m);
+      return enqueue_peering_evt(
+       pm->get_spg(),
+       PGPeeringEventRef(pm->get_event()));
+    }
+  }
+
   OpRequestRef op = op_tracker.create_request<OpRequest, Message*>(m);
   {
 #ifdef WITH_LTTNG
@@ -6753,12 +6768,6 @@ void OSD::dispatch_op(OpRequestRef op)
   case MSG_OSD_PG_TRIM:
     handle_pg_trim(op);
     break;
-  case MSG_OSD_BACKFILL_RESERVE:
-    handle_pg_backfill_reserve(op);
-    break;
-  case MSG_OSD_RECOVERY_RESERVE:
-    handle_pg_recovery_reserve(op);
-    break;
   }
 }
 
@@ -8604,36 +8613,6 @@ void OSD::handle_pg_trim(OpRequestRef op)
   pg->unlock();
 }
 
-void OSD::handle_pg_backfill_reserve(OpRequestRef op)
-{
-  MBackfillReserve *m = static_cast<MBackfillReserve*>(op->get_nonconst_req());
-  assert(m->get_type() == MSG_OSD_BACKFILL_RESERVE);
-
-  if (!require_osd_peer(op->get_req()))
-    return;
-  if (!require_same_or_newer_map(op, m->query_epoch, false))
-    return;
-
-  PGPeeringEventRef evt(m->get_event());
-
-  enqueue_peering_evt(m->pgid, evt);
-}
-
-void OSD::handle_pg_recovery_reserve(OpRequestRef op)
-{
-  MRecoveryReserve *m = static_cast<MRecoveryReserve*>(op->get_nonconst_req());
-  assert(m->get_type() == MSG_OSD_RECOVERY_RESERVE);
-
-  if (!require_osd_peer(op->get_req()))
-    return;
-  if (!require_same_or_newer_map(op, m->query_epoch, false))
-    return;
-
-  PGPeeringEventRef evt(m->get_event());
-
-  enqueue_peering_evt(m->pgid, evt);
-}
-
 void OSD::handle_force_recovery(Message *m)
 {
   MOSDForceRecovery *msg = static_cast<MOSDForceRecovery*>(m);
index f8107a593553b4416041df449d84f44fe2890cc5..7d074924dc9b38e33908e89878aae0bff8409501 100644 (file)
@@ -2015,9 +2015,6 @@ protected:
   void handle_pg_info(OpRequestRef op);
   void handle_pg_trim(OpRequestRef op);
 
-  void handle_pg_backfill_reserve(OpRequestRef op);
-  void handle_pg_recovery_reserve(OpRequestRef op);
-
   void handle_force_recovery(Message *m);
 
   void handle_pg_remove(OpRequestRef op);
@@ -2100,6 +2097,8 @@ private:
     switch (m->get_type()) {
     case CEPH_MSG_OSD_OP:
     case CEPH_MSG_OSD_BACKOFF:
+    case MSG_OSD_BACKFILL_RESERVE:
+    case MSG_OSD_RECOVERY_RESERVE:
     case MSG_OSD_REPOP:
     case MSG_OSD_REPOPREPLY:
     case MSG_OSD_PG_PUSH: