#include "common/Formatter.h"
#include "crimson/osd/pg.h"
#include "crimson/osd/osd.h"
+#include "crimson/osd/osd_operation_external_tracking.h"
#include "crimson/osd/osd_operations/peering_event.h"
#include "crimson/osd/osd_connection_priv.h"
}
return interruptor::with_interruption([this, pg] {
logger().debug("{}: pg present", *this);
- return with_blocking_future_interruptible<interruptor::condition>(
- handle.enter(pp(*pg).await_map)
+ return enter_stage<interruptor>(
+ pp(*pg).await_map
).then_interruptible([this, pg] {
- return with_blocking_future_interruptible<interruptor::condition>(
- pg->osdmap_gate.wait_for_map(evt.get_epoch_sent()));
+ return with_blocking_event<PG_OSDMapGate::OSDMapBlocker::BlockingEvent>(
+ [this, pg] (auto&& trigger) {
+ return pg->osdmap_gate.wait_for_map(std::move(trigger),
+ evt.get_epoch_sent());
+ });
}).then_interruptible([this, pg](auto) {
- return with_blocking_future_interruptible<interruptor::condition>(
- handle.enter(pp(*pg).process));
+ return enter_stage<interruptor>(pp(*pg).process);
}).then_interruptible([this, pg] {
// TODO: likely we should synchronize also with the pg log-based
// recovery.
- return with_blocking_future_interruptible<interruptor::condition>(
- handle.enter(BackfillRecovery::bp(*pg).process));
+ return enter_stage<interruptor>(BackfillRecovery::bp(*pg).process);
}).then_interruptible([this, pg] {
pg->do_peering_event(evt, ctx);
handle.exit();
seastar::future<Ref<PG>> RemotePeeringEvent::get_pg()
{
- return with_blocking_future(
- handle.enter(op().await_active)
- ).then([this] {
+#if 0
+ return enter_stage<>(op().await_active).then([this] {
return osd.state.when_active();
}).then([this] {
- return with_blocking_future(handle.enter(cp().await_map));
+ return enter_stage<>(cp().await_map);
}).then([this] {
return with_blocking_future(
osd.osdmap_gate.wait_for_map(evt.get_epoch_sent()));
osd.get_or_create_pg(
pgid, evt.get_epoch_sent(), std::move(evt.create_info)));
});
+#else
+ return seastar::make_ready_future<Ref<PG>>(nullptr);
+#endif
}
seastar::future<Ref<PG>> LocalPeeringEvent::get_pg() {
#include <iostream>
#include <seastar/core/future.hh>
+#include "crimson/osd/osdmap_gate.h"
#include "crimson/osd/osd_operation.h"
+#include "crimson/osd/osd_operations/background_recovery.h"
#include "osd/osd_types.h"
#include "osd/PGPeeringEvent.h"
#include "osd/PeeringState.h"
class ShardServices;
class PG;
-class PeeringEvent : public TrackableOperationT<PeeringEvent> {
+class PeeringEvent : public PhasedOperationT<PeeringEvent> {
public:
static constexpr OperationTypeCode type = OperationTypeCode::peering_event;
class PGPipeline {
- OrderedExclusivePhase await_map = {
- "PeeringEvent::PGPipeline::await_map"
- };
- OrderedExclusivePhase process = {
- "PeeringEvent::PGPipeline::process"
- };
+ struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
+ static constexpr auto type_name = "PeeringEvent::PGPipeline::await_map";
+ } await_map;
+ struct Process : OrderedExclusivePhaseT<Process> {
+ static constexpr auto type_name = "PeeringEvent::PGPipeline::process";
+ } process;
friend class PeeringEvent;
friend class PGAdvanceMap;
};
void print(std::ostream &) const final;
void dump_detail(ceph::Formatter* f) const final;
seastar::future<> start();
+
+ std::tuple<
+ StartEvent,
+ PGPipeline::AwaitMap::BlockingEvent,
+ PG_OSDMapGate::OSDMapBlocker::BlockingEvent,
+ PGPipeline::Process::BlockingEvent,
+ BackfillRecovery::BackfillRecoveryPipeline::Process::BlockingEvent,
+#if 0
+ PGPipeline::WaitForActive::BlockingEvent,
+ PGActivationBlocker::BlockingEvent,
+ PGPipeline::RecoverMissing::BlockingEvent,
+ PGPipeline::GetOBC::BlockingEvent,
+ PGPipeline::WaitRepop::BlockingEvent,
+ PGPipeline::SendReply::BlockingEvent,
+#endif
+ CompletionEvent
+ > tracking_events;
};
class RemotePeeringEvent : public PeeringEvent {
public:
class OSDPipeline {
- OrderedExclusivePhase await_active = {
- "PeeringRequest::OSDPipeline::await_active"
- };
+ struct AwaitActive : OrderedExclusivePhaseT<AwaitActive> {
+ static constexpr auto type_name =
+ "PeeringRequest::OSDPipeline::await_active";
+ } await_active;
friend class RemotePeeringEvent;
};
class ConnectionPipeline {
- OrderedExclusivePhase await_map = {
- "PeeringRequest::ConnectionPipeline::await_map"
- };
- OrderedExclusivePhase get_pg = {
- "PeeringRequest::ConnectionPipeline::get_pg"
- };
+ struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
+ static constexpr auto type_name =
+ "PeeringRequest::ConnectionPipeline::await_map";
+ } await_map;
+ struct GetPG : OrderedExclusivePhaseT<GetPG> {
+ static constexpr auto type_name =
+ "PeeringRequest::ConnectionPipeline::get_pg";
+ } get_pg;
friend class RemotePeeringEvent;
};
conn(conn)
{}
+ std::tuple<
+ OSDPipeline::AwaitActive::BlockingEvent,
+ ConnectionPipeline::AwaitMap::BlockingEvent,
+ ConnectionPipeline::GetPG::BlockingEvent
+ > tracking_events;
private:
ConnectionPipeline &cp();
OSDPipeline &op();