]> git.proxmox.com Git - ceph.git/blame - ceph/src/crimson/osd/osd_operations/logmissing_request.h
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / crimson / osd / osd_operations / logmissing_request.h
CommitLineData
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/MOSDPGUpdateLogMissing.h"
13
14namespace ceph {
15 class Formatter;
16}
17
18namespace crimson::osd {
19
20class ShardServices;
21
22class OSD;
23class PG;
24
25class LogMissingRequest final : public PhasedOperationT<LogMissingRequest> {
26public:
27 static constexpr OperationTypeCode type = OperationTypeCode::logmissing_request;
28 LogMissingRequest(crimson::net::ConnectionRef&&, Ref<MOSDPGUpdateLogMissing>&&);
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,
aee94f69
TL
62 ClientRequest::PGPipeline::AwaitMap::BlockingEvent,
63 PG_OSDMapGate::OSDMapBlocker::BlockingEvent,
1e59de90
TL
64 PGMap::PGCreationBlockingEvent,
65 OSD_OSDMapGate::OSDMapBlocker::BlockingEvent
66 > tracking_events;
67
68private:
aee94f69 69 ClientRequest::PGPipeline &client_pp(PG &pg);
1e59de90
TL
70
71 crimson::net::ConnectionRef conn;
72 // must be after `conn` to ensure the ConnectionPipeline's is alive
73 PipelineHandle handle;
74 Ref<MOSDPGUpdateLogMissing> req;
75};
76
77}
78
79#if FMT_VERSION >= 90000
80template <> struct fmt::formatter<crimson::osd::LogMissingRequest> : fmt::ostream_formatter {};
81#endif