blob: 17c2faf97ea98af3b2c785d8615c10f6739178bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#pragma once
#include "osd/osd_op_util.h"
#include "crimson/net/Connection.h"
#include "crimson/osd/osd_operation.h"
#include "crimson/osd/pg.h"
#include "crimson/common/type_helpers.h"
#include "messages/MOSDFastDispatchOp.h"
namespace crimson::osd {
class PG;
class RecoverySubRequest final : public PhasedOperationT<RecoverySubRequest> {
public:
static constexpr OperationTypeCode type =
OperationTypeCode::background_recovery_sub;
RecoverySubRequest(
crimson::net::ConnectionRef conn,
Ref<MOSDFastDispatchOp>&& m)
: l_conn(conn), m(m) {}
void print(std::ostream& out) const final
{
out << *m;
}
void dump_detail(Formatter *f) const final
{
}
static constexpr bool can_create() { return false; }
spg_t get_pgid() const {
return m->get_spg();
}
PipelineHandle &get_handle() { return handle; }
epoch_t get_epoch() const { return m->get_min_epoch(); }
ConnectionPipeline &get_connection_pipeline();
PerShardPipeline &get_pershard_pipeline(ShardServices &);
crimson::net::Connection &get_local_connection() {
assert(l_conn);
assert(!r_conn);
return *l_conn;
};
crimson::net::Connection &get_foreign_connection() {
assert(r_conn);
assert(!l_conn);
return *r_conn;
};
crimson::net::ConnectionFFRef prepare_remote_submission() {
assert(l_conn);
assert(!r_conn);
auto ret = seastar::make_foreign(std::move(l_conn));
l_conn.reset();
return ret;
}
void finish_remote_submission(crimson::net::ConnectionFFRef conn) {
assert(conn);
assert(!l_conn);
assert(!r_conn);
r_conn = make_local_shared_foreign(std::move(conn));
}
seastar::future<> with_pg(
ShardServices &shard_services, Ref<PG> pg);
std::tuple<
StartEvent,
ConnectionPipeline::AwaitActive::BlockingEvent,
ConnectionPipeline::AwaitMap::BlockingEvent,
ConnectionPipeline::GetPGMapping::BlockingEvent,
PerShardPipeline::CreateOrWaitPG::BlockingEvent,
PGMap::PGCreationBlockingEvent,
OSD_OSDMapGate::OSDMapBlocker::BlockingEvent,
CompletionEvent
> tracking_events;
private:
crimson::net::ConnectionRef l_conn;
crimson::net::ConnectionXcoreRef r_conn;
// must be after `conn` to ensure the ConnectionPipeline's is alive
PipelineHandle handle;
Ref<MOSDFastDispatchOp> m;
};
}
#if FMT_VERSION >= 90000
template <> struct fmt::formatter<crimson::osd::RecoverySubRequest> : fmt::ostream_formatter {};
#endif
|