crimson/osd: migrate RepRequest to new tracking infra

Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
This commit is contained in:
Radosław Zarzyński 2022-04-15 20:16:09 +02:00
parent 11ed546e10
commit 313337983f
2 changed files with 35 additions and 17 deletions
src/crimson/osd/osd_operations

View File

@ -8,6 +8,7 @@
#include "crimson/osd/osd.h"
#include "crimson/osd/osd_connection_priv.h"
#include "crimson/osd/osd_operation_external_tracking.h"
#include "crimson/osd/pg.h"
namespace {
@ -61,13 +62,19 @@ seastar::future<> RepRequest::start()
logger().debug("{} start", *this);
IRef ref = this;
return with_blocking_future(handle.enter(cp().await_map))
.then([this]() {
return with_blocking_future(osd.osdmap_gate.wait_for_map(req->get_min_epoch()));
return enter_stage<>(cp().await_map).then([this] {
return with_blocking_event<OSD_OSDMapGate::OSDMapBlocker::BlockingEvent>(
[this] (auto&& trigger) {
return osd.osdmap_gate.wait_for_map(std::move(trigger),
req->get_min_epoch());
});
}).then([this](epoch_t epoch) {
return with_blocking_future(handle.enter(cp().get_pg));
return enter_stage<>(cp().get_pg);
}).then([this] {
return with_blocking_future(osd.wait_for_pg(req->get_spg()));
return with_blocking_event<PGMap::PGCreationBlockingEvent>(
[this] (auto&& trigger) {
return osd.wait_for_pg(std::move(trigger), req->get_spg());
});
}).then([this, ref=std::move(ref)](Ref<PG> pg) {
return interruptor::with_interruption([this, ref, pg] {
return pg->handle_rep_op(std::move(req));

View File

@ -4,7 +4,9 @@
#pragma once
#include "crimson/net/Connection.h"
#include "crimson/osd/osdmap_gate.h"
#include "crimson/osd/osd_operation.h"
#include "crimson/osd/pg_map.h"
#include "crimson/common/type_helpers.h"
class MOSDRepOp;
@ -21,21 +23,23 @@ class PG;
class RepRequest final : public PhasedOperationT<RepRequest> {
public:
class ConnectionPipeline {
OrderedExclusivePhase await_map = {
"RepRequest::ConnectionPipeline::await_map"
};
OrderedExclusivePhase get_pg = {
"RepRequest::ConnectionPipeline::get_pg"
};
struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
static constexpr auto type_name =
"RepRequest::ConnectionPipeline::await_map";
} await_map;
struct GetPG : OrderedExclusivePhaseT<GetPG> {
static constexpr auto type_name =
"RepRequest::ConnectionPipeline::get_pg";
} get_pg;
friend RepRequest;
};
class PGPipeline {
OrderedExclusivePhase await_map = {
"RepRequest::PGPipeline::await_map"
};
OrderedExclusivePhase process = {
"RepRequest::PGPipeline::process"
};
struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
static constexpr auto type_name = "RepRequest::PGPipeline::await_map";
} await_map;
struct Process : OrderedExclusivePhaseT<Process> {
static constexpr auto type_name = "RepRequest::PGPipeline::process";
} process;
friend RepRequest;
};
static constexpr OperationTypeCode type = OperationTypeCode::replicated_request;
@ -45,6 +49,13 @@ public:
void dump_detail(ceph::Formatter* f) const final;
seastar::future<> start();
std::tuple<
ConnectionPipeline::AwaitMap::BlockingEvent,
OSD_OSDMapGate::OSDMapBlocker::BlockingEvent,
ConnectionPipeline::GetPG::BlockingEvent,
PGMap::PGCreationBlockingEvent
> tracking_events;
private:
ConnectionPipeline &cp();
PGPipeline &pp(PG &pg);