]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/osd_operation_external_tracking.h
update ceph source to reef 18.1.2
[ceph.git] / 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
3
4 #pragma once
5
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"
17
18 namespace crimson::osd {
19
20 // Just the boilerplate currently. Implementing
21 struct LttngBackend
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
39 {
40 void handle(ClientRequest::StartEvent&,
41 const Operation&) override {}
42
43 void handle(ConnectionPipeline::AwaitActive::BlockingEvent& ev,
44 const Operation& op,
45 const ConnectionPipeline::AwaitActive& blocker) override {
46 }
47
48 void handle(ConnectionPipeline::AwaitMap::BlockingEvent& ev,
49 const Operation& op,
50 const ConnectionPipeline::AwaitMap& blocker) override {
51 }
52
53 void handle(OSD_OSDMapGate::OSDMapBlocker::BlockingEvent&,
54 const Operation&,
55 const OSD_OSDMapGate::OSDMapBlocker&) override {
56 }
57
58 void handle(ConnectionPipeline::GetPG::BlockingEvent& ev,
59 const Operation& op,
60 const ConnectionPipeline::GetPG& blocker) override {
61 }
62
63 void handle(PGMap::PGCreationBlockingEvent&,
64 const Operation&,
65 const PGMap::PGCreationBlocker&) override {
66 }
67
68 void handle(ClientRequest::PGPipeline::AwaitMap::BlockingEvent& ev,
69 const Operation& op,
70 const ClientRequest::PGPipeline::AwaitMap& blocker) override {
71 }
72
73 void handle(PG_OSDMapGate::OSDMapBlocker::BlockingEvent&,
74 const Operation&,
75 const PG_OSDMapGate::OSDMapBlocker&) override {
76 }
77
78 void handle(ClientRequest::PGPipeline::WaitForActive::BlockingEvent& ev,
79 const Operation& op,
80 const ClientRequest::PGPipeline::WaitForActive& blocker) override {
81 }
82
83 void handle(PGActivationBlocker::BlockingEvent& ev,
84 const Operation& op,
85 const PGActivationBlocker& blocker) override {
86 }
87
88 void handle(ClientRequest::PGPipeline::RecoverMissing::BlockingEvent& ev,
89 const Operation& op,
90 const ClientRequest::PGPipeline::RecoverMissing& blocker) override {
91 }
92
93 void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev,
94 const Operation& op,
95 const ClientRequest::PGPipeline::GetOBC& blocker) override {
96 }
97
98 void handle(ClientRequest::PGPipeline::Process::BlockingEvent& ev,
99 const Operation& op,
100 const ClientRequest::PGPipeline::Process& blocker) override {
101 }
102
103 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent& ev,
104 const Operation& op,
105 const ClientRequest::PGPipeline::WaitRepop& blocker) override {
106 }
107
108 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent& ev,
109 const Operation& op) override {
110 }
111
112 void handle(ClientRequest::PGPipeline::SendReply::BlockingEvent& ev,
113 const Operation& op,
114 const ClientRequest::PGPipeline::SendReply& blocker) override {
115 }
116
117 void handle(ClientRequest::CompletionEvent&,
118 const Operation&) override {}
119 };
120
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
139 {
140 void handle(ClientRequest::StartEvent&,
141 const Operation&) override {}
142
143 void handle(ConnectionPipeline::AwaitActive::BlockingEvent& ev,
144 const Operation& op,
145 const ConnectionPipeline::AwaitActive& blocker) override {
146 }
147
148 void handle(ConnectionPipeline::AwaitMap::BlockingEvent& ev,
149 const Operation& op,
150 const ConnectionPipeline::AwaitMap& blocker) override {
151 }
152
153 void handle(OSD_OSDMapGate::OSDMapBlocker::BlockingEvent&,
154 const Operation&,
155 const OSD_OSDMapGate::OSDMapBlocker&) override {
156 }
157
158 void handle(ConnectionPipeline::GetPG::BlockingEvent& ev,
159 const Operation& op,
160 const ConnectionPipeline::GetPG& blocker) override {
161 }
162
163 void handle(PGMap::PGCreationBlockingEvent&,
164 const Operation&,
165 const PGMap::PGCreationBlocker&) override {
166 }
167
168 void handle(ClientRequest::PGPipeline::AwaitMap::BlockingEvent& ev,
169 const Operation& op,
170 const ClientRequest::PGPipeline::AwaitMap& blocker) override {
171 }
172
173 void handle(PG_OSDMapGate::OSDMapBlocker::BlockingEvent&,
174 const Operation&,
175 const PG_OSDMapGate::OSDMapBlocker&) override {
176 }
177
178 void handle(ClientRequest::PGPipeline::WaitForActive::BlockingEvent& ev,
179 const Operation& op,
180 const ClientRequest::PGPipeline::WaitForActive& blocker) override {
181 }
182
183 void handle(PGActivationBlocker::BlockingEvent& ev,
184 const Operation& op,
185 const PGActivationBlocker& blocker) override {
186 }
187
188 void handle(ClientRequest::PGPipeline::RecoverMissing::BlockingEvent& ev,
189 const Operation& op,
190 const ClientRequest::PGPipeline::RecoverMissing& blocker) override {
191 }
192
193 void handle(ClientRequest::PGPipeline::GetOBC::BlockingEvent& ev,
194 const Operation& op,
195 const ClientRequest::PGPipeline::GetOBC& blocker) override {
196 }
197
198 void handle(ClientRequest::PGPipeline::Process::BlockingEvent& ev,
199 const Operation& op,
200 const ClientRequest::PGPipeline::Process& blocker) override {
201 }
202
203 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent& ev,
204 const Operation& op,
205 const ClientRequest::PGPipeline::WaitRepop& blocker) override {
206 }
207
208 void handle(ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent& ev,
209 const Operation& op) override {
210 }
211
212 void handle(ClientRequest::PGPipeline::SendReply::BlockingEvent& ev,
213 const Operation& op,
214 const ClientRequest::PGPipeline::SendReply& blocker) override {
215 }
216
217 static const ClientRequest& to_client_request(const Operation& op) {
218 #ifdef NDEBUG
219 return static_cast<const ClientRequest&>(op);
220 #else
221 return dynamic_cast<const ClientRequest&>(op);
222 #endif
223 }
224
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();
228 }
229 }
230 };
231
232 } // namespace crimson::osd
233
234 namespace crimson {
235
236 template <>
237 struct EventBackendRegistry<osd::ClientRequest> {
238 static std::tuple<osd::LttngBackend, osd::HistoricBackend> get_backends() {
239 return { {}, {} };
240 }
241 };
242
243 template <>
244 struct EventBackendRegistry<osd::RemotePeeringEvent> {
245 static std::tuple<> get_backends() {
246 return {/* no extenral backends */};
247 }
248 };
249
250 template <>
251 struct EventBackendRegistry<osd::LocalPeeringEvent> {
252 static std::tuple<> get_backends() {
253 return {/* no extenral backends */};
254 }
255 };
256
257 template <>
258 struct EventBackendRegistry<osd::RepRequest> {
259 static std::tuple<> get_backends() {
260 return {/* no extenral backends */};
261 }
262 };
263
264
265 template <>
266 struct EventBackendRegistry<osd::LogMissingRequest> {
267 static std::tuple<> get_backends() {
268 return {/* no extenral backends */};
269 }
270 };
271
272 template <>
273 struct EventBackendRegistry<osd::LogMissingRequestReply> {
274 static std::tuple<> get_backends() {
275 return {/* no extenral backends */};
276 }
277 };
278
279 template <>
280 struct EventBackendRegistry<osd::RecoverySubRequest> {
281 static std::tuple<> get_backends() {
282 return {/* no extenral backends */};
283 }
284 };
285
286 template <>
287 struct EventBackendRegistry<osd::BackfillRecovery> {
288 static std::tuple<> get_backends() {
289 return {};
290 }
291 };
292
293 template <>
294 struct EventBackendRegistry<osd::PGAdvanceMap> {
295 static std::tuple<> get_backends() {
296 return {};
297 }
298 };
299
300 template <>
301 struct EventBackendRegistry<osd::SnapTrimObjSubEvent> {
302 static std::tuple<> get_backends() {
303 return {};
304 }
305 };
306
307 } // namespace crimson