crimson: add osd interface for recovery messages

Signed-off-by: Xuehan Xu <xxhdx1985126@163.com>
This commit is contained in:
Xuehan Xu 2020-03-04 17:58:24 +08:00
parent 7b0462fce7
commit b39d6e03b3
2 changed files with 33 additions and 1 deletions

View File

@ -21,6 +21,11 @@
#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)) {

View 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,