]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | #include <fmt/format.h> |
2 | #include <fmt/ostream.h> | |
3 | ||
4 | #include "crimson/osd/osd_operations/recovery_subrequest.h" | |
1e59de90 TL |
5 | #include "crimson/osd/pg.h" |
6 | #include "crimson/osd/osd_connection_priv.h" | |
f67539c2 TL |
7 | |
8 | namespace { | |
9 | seastar::logger& logger() { | |
10 | return crimson::get_logger(ceph_subsys_osd); | |
11 | } | |
12 | } | |
13 | ||
1e59de90 TL |
14 | namespace crimson { |
15 | template <> | |
16 | struct EventBackendRegistry<osd::RecoverySubRequest> { | |
17 | static std::tuple<> get_backends() { | |
18 | return {}; | |
19 | } | |
20 | }; | |
21 | } | |
22 | ||
f67539c2 TL |
23 | namespace crimson::osd { |
24 | ||
1e59de90 TL |
25 | seastar::future<> RecoverySubRequest::with_pg( |
26 | ShardServices &shard_services, Ref<PG> pgref) | |
27 | { | |
28 | logger().debug("{}: {}", "RecoverySubRequest::with_pg", *this); | |
f67539c2 | 29 | |
1e59de90 | 30 | track_event<StartEvent>(); |
f67539c2 | 31 | IRef opref = this; |
1e59de90 TL |
32 | return interruptor::with_interruption([this, pgref] { |
33 | return pgref->get_recovery_backend()->handle_recovery_op(m, conn); | |
34 | }, [](std::exception_ptr) { | |
35 | return seastar::now(); | |
36 | }, pgref).finally([this, opref, pgref] { | |
37 | track_event<CompletionEvent>(); | |
f67539c2 TL |
38 | }); |
39 | } | |
40 | ||
1e59de90 TL |
41 | ConnectionPipeline &RecoverySubRequest::get_connection_pipeline() |
42 | { | |
43 | return get_osd_priv(conn.get()).peering_request_conn_pipeline; | |
44 | } | |
45 | ||
f67539c2 | 46 | } |