]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/osd_operation_external_tracking.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
6 #include "crimson/osd/osd.h"
7 #include "crimson/osd/osdmap_gate.h"
8 #include "crimson/osd/osd_operations/background_recovery.h"
9 #include "crimson/osd/osd_operations/client_request.h"
10 #include "crimson/osd/osd_operations/peering_event.h"
11 #include "crimson/osd/osd_operations/pg_advance_map.h"
12 #include "crimson/osd/osd_operations/recovery_subrequest.h"
13 #include "crimson/osd/osd_operations/replicated_request.h"
14 #include "crimson/osd/osd_operations/snaptrim_event.h"
15 #include "crimson/osd/pg_activation_blocker.h"
16 #include "crimson/osd/pg_map.h"
18 namespace crimson::osd
{
20 // Just the boilerplate currently. Implementing
22 : ClientRequest::StartEvent::Backend
,
23 ConnectionPipeline::AwaitActive::BlockingEvent::Backend
,
24 ConnectionPipeline::AwaitMap::BlockingEvent::Backend
,
25 ConnectionPipeline::GetPG::BlockingEvent::Backend
,
26 OSD_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend
,
27 PGMap::PGCreationBlockingEvent::Backend
,
28 ClientRequest::PGPipeline::AwaitMap::BlockingEvent::Backend
,
29 PG_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend
,
30 ClientRequest::PGPipeline::WaitForActive::BlockingEvent::Backend
,
31 PGActivationBlocker::BlockingEvent::Backend
,
32 ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend
,
33 ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend
,
34 ClientRequest::PGPipeline::Process::BlockingEvent::Backend
,
35 ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend
,
36 ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend
,
37 ClientRequest::PGPipeline::SendReply::BlockingEvent::Backend
,
38 ClientRequest::CompletionEvent::Backend
40 void handle(ClientRequest::StartEvent
&,
41 const Operation
&) override
{}
43 void handle(ConnectionPipeline::AwaitActive::BlockingEvent
& ev
,
45 const ConnectionPipeline::AwaitActive
& blocker
) override
{
48 void handle(ConnectionPipeline::AwaitMap::BlockingEvent
& ev
,
50 const ConnectionPipeline::AwaitMap
& blocker
) override
{
53 void handle(OSD_OSDMapGate::OSDMapBlocker::BlockingEvent
&,
55 const OSD_OSDMapGate::OSDMapBlocker
&) override
{
58 void handle(ConnectionPipeline::GetPG::BlockingEvent
& ev
,
60 const ConnectionPipeline::GetPG
& blocker
) override
{
63 void handle(PGMap::PGCreationBlockingEvent
&,
65 const PGMap::PGCreationBlocker
&) override
{
68 void handle(ClientRequest::PGPipeline::AwaitMap::BlockingEvent
& ev
,
70 const ClientRequest::PGPipeline::AwaitMap
& blocker
) override
{
73 void handle(PG_OSDMapGate::OSDMapBlocker::BlockingEvent
&,
75 const PG_OSDMapGate::OSDMapBlocker
&) override
{
78 void handle(ClientRequest::PGPipeline::WaitForActive::BlockingEvent
& ev
,
80 const ClientRequest::PGPipeline::WaitForActive
& blocker
) override
{
83 void handle(PGActivationBlocker::BlockingEvent
& ev
,
85 const PGActivationBlocker
& blocker
) override
{
88 void handle(ClientRequest::PGPipeline::RecoverMissing::BlockingEvent
& ev
,
90 const ClientRequest::PGPipeline::RecoverMissing
& blocker
) override
{
93 void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent
& ev
,
95 const ClientRequest::PGPipeline::GetOBC
& blocker
) override
{
98 void handle(ClientRequest::PGPipeline::Process::BlockingEvent
& ev
,
100 const ClientRequest::PGPipeline::Process
& blocker
) override
{
103 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent
& ev
,
105 const ClientRequest::PGPipeline::WaitRepop
& blocker
) override
{
108 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent
& ev
,
109 const Operation
& op
) override
{
112 void handle(ClientRequest::PGPipeline::SendReply::BlockingEvent
& ev
,
114 const ClientRequest::PGPipeline::SendReply
& blocker
) override
{
117 void handle(ClientRequest::CompletionEvent
&,
118 const Operation
&) override
{}
121 struct HistoricBackend
122 : ClientRequest::StartEvent::Backend
,
123 ConnectionPipeline::AwaitActive::BlockingEvent::Backend
,
124 ConnectionPipeline::AwaitMap::BlockingEvent::Backend
,
125 ConnectionPipeline::GetPG::BlockingEvent::Backend
,
126 OSD_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend
,
127 PGMap::PGCreationBlockingEvent::Backend
,
128 ClientRequest::PGPipeline::AwaitMap::BlockingEvent::Backend
,
129 PG_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend
,
130 ClientRequest::PGPipeline::WaitForActive::BlockingEvent::Backend
,
131 PGActivationBlocker::BlockingEvent::Backend
,
132 ClientRequest::PGPipeline::RecoverMissing::BlockingEvent::Backend
,
133 ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend
,
134 ClientRequest::PGPipeline::Process::BlockingEvent::Backend
,
135 ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend
,
136 ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend
,
137 ClientRequest::PGPipeline::SendReply::BlockingEvent::Backend
,
138 ClientRequest::CompletionEvent::Backend
140 void handle(ClientRequest::StartEvent
&,
141 const Operation
&) override
{}
143 void handle(ConnectionPipeline::AwaitActive::BlockingEvent
& ev
,
145 const ConnectionPipeline::AwaitActive
& blocker
) override
{
148 void handle(ConnectionPipeline::AwaitMap::BlockingEvent
& ev
,
150 const ConnectionPipeline::AwaitMap
& blocker
) override
{
153 void handle(OSD_OSDMapGate::OSDMapBlocker::BlockingEvent
&,
155 const OSD_OSDMapGate::OSDMapBlocker
&) override
{
158 void handle(ConnectionPipeline::GetPG::BlockingEvent
& ev
,
160 const ConnectionPipeline::GetPG
& blocker
) override
{
163 void handle(PGMap::PGCreationBlockingEvent
&,
165 const PGMap::PGCreationBlocker
&) override
{
168 void handle(ClientRequest::PGPipeline::AwaitMap::BlockingEvent
& ev
,
170 const ClientRequest::PGPipeline::AwaitMap
& blocker
) override
{
173 void handle(PG_OSDMapGate::OSDMapBlocker::BlockingEvent
&,
175 const PG_OSDMapGate::OSDMapBlocker
&) override
{
178 void handle(ClientRequest::PGPipeline::WaitForActive::BlockingEvent
& ev
,
180 const ClientRequest::PGPipeline::WaitForActive
& blocker
) override
{
183 void handle(PGActivationBlocker::BlockingEvent
& ev
,
185 const PGActivationBlocker
& blocker
) override
{
188 void handle(ClientRequest::PGPipeline::RecoverMissing::BlockingEvent
& ev
,
190 const ClientRequest::PGPipeline::RecoverMissing
& blocker
) override
{
193 void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent
& ev
,
195 const ClientRequest::PGPipeline::GetOBC
& blocker
) override
{
198 void handle(ClientRequest::PGPipeline::Process::BlockingEvent
& ev
,
200 const ClientRequest::PGPipeline::Process
& blocker
) override
{
203 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent
& ev
,
205 const ClientRequest::PGPipeline::WaitRepop
& blocker
) override
{
208 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent
& ev
,
209 const Operation
& op
) override
{
212 void handle(ClientRequest::PGPipeline::SendReply::BlockingEvent
& ev
,
214 const ClientRequest::PGPipeline::SendReply
& blocker
) override
{
217 static const ClientRequest
& to_client_request(const Operation
& op
) {
219 return static_cast<const ClientRequest
&>(op
);
221 return dynamic_cast<const ClientRequest
&>(op
);
225 void handle(ClientRequest::CompletionEvent
&, const Operation
& op
) override
{
226 if (crimson::common::local_conf()->osd_op_history_size
) {
227 to_client_request(op
).put_historic();
232 } // namespace crimson::osd
237 struct EventBackendRegistry
<osd::ClientRequest
> {
238 static std::tuple
<osd::LttngBackend
, osd::HistoricBackend
> get_backends() {
244 struct EventBackendRegistry
<osd::RemotePeeringEvent
> {
245 static std::tuple
<> get_backends() {
246 return {/* no extenral backends */};
251 struct EventBackendRegistry
<osd::LocalPeeringEvent
> {
252 static std::tuple
<> get_backends() {
253 return {/* no extenral backends */};
258 struct EventBackendRegistry
<osd::RepRequest
> {
259 static std::tuple
<> get_backends() {
260 return {/* no extenral backends */};
266 struct EventBackendRegistry
<osd::LogMissingRequest
> {
267 static std::tuple
<> get_backends() {
268 return {/* no extenral backends */};
273 struct EventBackendRegistry
<osd::LogMissingRequestReply
> {
274 static std::tuple
<> get_backends() {
275 return {/* no extenral backends */};
280 struct EventBackendRegistry
<osd::RecoverySubRequest
> {
281 static std::tuple
<> get_backends() {
282 return {/* no extenral backends */};
287 struct EventBackendRegistry
<osd::BackfillRecovery
> {
288 static std::tuple
<> get_backends() {
294 struct EventBackendRegistry
<osd::PGAdvanceMap
> {
295 static std::tuple
<> get_backends() {
301 struct EventBackendRegistry
<osd::SnapTrimObjSubEvent
> {
302 static std::tuple
<> get_backends() {
307 } // namespace crimson