]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/osd_operations/pg_advance_map.h
c7277f790b3d289166cf6d48b0c0aa6f31ae5cb2
[ceph.git] / ceph / src / crimson / osd / osd_operations / pg_advance_map.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 <iostream>
7 #include <seastar/core/future.hh>
8
9 #include "crimson/osd/osd_operation.h"
10 #include "crimson/osd/osd_operations/peering_event.h"
11 #include "osd/osd_types.h"
12 #include "crimson/common/type_helpers.h"
13
14 namespace ceph {
15 class Formatter;
16 }
17
18 namespace crimson::osd {
19
20 class ShardServices;
21 class PG;
22
23 class PGAdvanceMap : public PhasedOperationT<PGAdvanceMap> {
24 public:
25 static constexpr OperationTypeCode type = OperationTypeCode::pg_advance_map;
26
27 protected:
28 ShardServices &shard_services;
29 Ref<PG> pg;
30 PipelineHandle handle;
31
32 std::optional<epoch_t> from;
33 epoch_t to;
34
35 PeeringCtx rctx;
36 const bool do_init;
37
38 public:
39 PGAdvanceMap(
40 ShardServices &shard_services, Ref<PG> pg, epoch_t to,
41 PeeringCtx &&rctx, bool do_init);
42 ~PGAdvanceMap();
43
44 void print(std::ostream &) const final;
45 void dump_detail(ceph::Formatter *f) const final;
46 seastar::future<> start();
47 PipelineHandle &get_handle() { return handle; }
48
49 std::tuple<
50 PGPeeringPipeline::Process::BlockingEvent
51 > tracking_events;
52 };
53
54 }
55
56 #if FMT_VERSION >= 90000
57 template <> struct fmt::formatter<crimson::osd::PGAdvanceMap> : fmt::ostream_formatter {};
58 #endif