]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: add osd interface for recovery messages
authorXuehan Xu <xxhdx1985126@163.com>
Wed, 4 Mar 2020 09:58:24 +0000 (17:58 +0800)
committerXuehan Xu <xxhdx1985126@163.com>
Sun, 26 Apr 2020 07:46:35 +0000 (15:46 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@163.com>
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index 0a1ed9ed57ee279a3806c5aa05a02fbd475c9b7a..65fc121587eff0911e47f8e693fc13be6a5499ab 100644 (file)
 #include "messages/MOSDMap.h"
 #include "messages/MOSDOp.h"
 #include "messages/MOSDPGLog.h"
+#include "messages/MOSDPGPull.h"
+#include "messages/MOSDPGPush.h"
+#include "messages/MOSDPGPushReply.h"
+#include "messages/MOSDPGRecoveryDelete.h"
+#include "messages/MOSDPGRecoveryDeleteReply.h"
 #include "messages/MOSDRepOpReply.h"
 #include "messages/MPGStats.h"
 
@@ -32,7 +37,6 @@
 #include "crimson/mon/MonClient.h"
 #include "crimson/net/Connection.h"
 #include "crimson/net/Messenger.h"
-#include "crimson/os/cyanstore/cyan_object.h"
 #include "crimson/os/futurized_collection.h"
 #include "crimson/os/futurized_store.h"
 #include "crimson/osd/heartbeat.h"
@@ -44,6 +48,7 @@
 #include "crimson/osd/osd_operations/compound_peering_request.h"
 #include "crimson/osd/osd_operations/peering_event.h"
 #include "crimson/osd/osd_operations/pg_advance_map.h"
+#include "crimson/osd/osd_operations/recovery_subrequest.h"
 #include "crimson/osd/osd_operations/replicated_request.h"
 
 namespace {
@@ -585,6 +590,16 @@ seastar::future<> OSD::ms_dispatch(crimson::net::Connection* conn, MessageRef m)
     return seastar::now();
   case MSG_COMMAND:
     return handle_command(conn, boost::static_pointer_cast<MCommand>(m));
+  case MSG_OSD_PG_PULL:
+    [[fallthrough]];
+  case MSG_OSD_PG_PUSH:
+    [[fallthrough]];
+  case MSG_OSD_PG_PUSH_REPLY:
+    [[fallthrough]];
+  case MSG_OSD_PG_RECOVERY_DELETE:
+    [[fallthrough]];
+  case MSG_OSD_PG_RECOVERY_DELETE_REPLY:
+    return handle_recovery_subreq(conn, boost::static_pointer_cast<MOSDFastDispatchOp>(m));
   case MSG_OSD_PG_LEASE:
     [[fallthrough]];
   case MSG_OSD_PG_LEASE_ACK:
@@ -595,6 +610,10 @@ seastar::future<> OSD::ms_dispatch(crimson::net::Connection* conn, MessageRef m)
     [[fallthrough]];
   case MSG_OSD_PG_QUERY2:
     [[fallthrough]];
+  case MSG_OSD_BACKFILL_RESERVE:
+    [[fallthrough]];
+  case MSG_OSD_RECOVERY_RESERVE:
+    [[fallthrough]];
   case MSG_OSD_PG_LOG:
     return handle_peering_op(conn, boost::static_pointer_cast<MOSDPeeringOp>(m));
   case MSG_OSD_REPOP:
@@ -995,6 +1014,16 @@ seastar::future<> OSD::handle_rep_op_reply(crimson::net::Connection* conn,
   return seastar::now();
 }
 
+seastar::future<> OSD::handle_recovery_subreq(crimson::net::Connection* conn,
+                                  Ref<MOSDFastDispatchOp> m)
+{
+  shard_services.start_operation<RecoverySubRequest>(
+    *this,
+    conn->get_shared(),
+    std::move(m));
+  return seastar::now();
+}
+
 bool OSD::should_restart() const
 {
   if (!osdmap->is_up(whoami)) {
index b6b6c270d31267b564c56434f8cf7fa9cbd9e64a..d0f7c2230bd3a9941233045b912b7c31ac200098 100644 (file)
@@ -180,6 +180,9 @@ private:
                                        Ref<MOSDRepOpReply> m);
   seastar::future<> handle_peering_op(crimson::net::Connection* conn,
                                      Ref<MOSDPeeringOp> m);
+  seastar::future<> handle_recovery_subreq(crimson::net::Connection* conn,
+                                          Ref<MOSDFastDispatchOp> m);
+
 
   seastar::future<> committed_osd_maps(version_t first,
                                        version_t last,