]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
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/net/Connection.h" | |
7 | #include "crimson/osd/osdmap_gate.h" | |
8 | #include "crimson/osd/osd_operation.h" | |
9 | #include "crimson/osd/osd_operations/client_request.h" | |
10 | #include "crimson/osd/pg_map.h" | |
11 | #include "crimson/common/type_helpers.h" | |
12 | #include "messages/MOSDPGUpdateLogMissingReply.h" | |
13 | ||
14 | namespace ceph { | |
15 | class Formatter; | |
16 | } | |
17 | ||
18 | namespace crimson::osd { | |
19 | ||
20 | class ShardServices; | |
21 | ||
22 | class OSD; | |
23 | class PG; | |
24 | ||
25 | class LogMissingRequestReply final : public PhasedOperationT<LogMissingRequestReply> { | |
26 | public: | |
27 | static constexpr OperationTypeCode type = OperationTypeCode::logmissing_request_reply; | |
28 | LogMissingRequestReply(crimson::net::ConnectionRef&&, Ref<MOSDPGUpdateLogMissingReply>&&); | |
29 | ||
30 | void print(std::ostream &) const final; | |
31 | void dump_detail(ceph::Formatter* f) const final; | |
32 | ||
33 | static constexpr bool can_create() { return false; } | |
34 | spg_t get_pgid() const { | |
35 | return req->get_spg(); | |
36 | } | |
37 | PipelineHandle &get_handle() { return handle; } | |
38 | epoch_t get_epoch() const { return req->get_min_epoch(); } | |
39 | ||
40 | ConnectionPipeline &get_connection_pipeline(); | |
41 | seastar::future<crimson::net::ConnectionFRef> prepare_remote_submission() { | |
42 | assert(conn); | |
43 | return conn.get_foreign( | |
44 | ).then([this](auto f_conn) { | |
45 | conn.reset(); | |
46 | return f_conn; | |
47 | }); | |
48 | } | |
49 | void finish_remote_submission(crimson::net::ConnectionFRef _conn) { | |
50 | assert(!conn); | |
51 | conn = make_local_shared_foreign(std::move(_conn)); | |
52 | } | |
53 | ||
54 | seastar::future<> with_pg( | |
55 | ShardServices &shard_services, Ref<PG> pg); | |
56 | ||
57 | std::tuple< | |
58 | StartEvent, | |
59 | ConnectionPipeline::AwaitActive::BlockingEvent, | |
60 | ConnectionPipeline::AwaitMap::BlockingEvent, | |
61 | ConnectionPipeline::GetPG::BlockingEvent, | |
62 | PGMap::PGCreationBlockingEvent, | |
63 | OSD_OSDMapGate::OSDMapBlocker::BlockingEvent | |
64 | > tracking_events; | |
65 | ||
66 | private: | |
67 | ClientRequest::PGPipeline &pp(PG &pg); | |
68 | ||
69 | crimson::net::ConnectionRef conn; | |
70 | // must be after `conn` to ensure the ConnectionPipeline's is alive | |
71 | PipelineHandle handle; | |
72 | Ref<MOSDPGUpdateLogMissingReply> req; | |
73 | }; | |
74 | ||
75 | } | |
76 | ||
77 | #if FMT_VERSION >= 90000 | |
78 | template <> struct fmt::formatter<crimson::osd::LogMissingRequestReply> : fmt::ostream_formatter {}; | |
79 | #endif |