]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/osd_operations/logmissing_request_reply.cc
95a968c1455d2d737df454372adcdc1012517de2
[ceph.git] / ceph / src / crimson / osd / osd_operations / logmissing_request_reply.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "logmissing_request_reply.h"
5
6 #include "common/Formatter.h"
7
8 #include "crimson/osd/osd.h"
9 #include "crimson/osd/osd_connection_priv.h"
10 #include "crimson/osd/osd_operation_external_tracking.h"
11 #include "crimson/osd/pg.h"
12
13 namespace {
14 seastar::logger& logger() {
15 return crimson::get_logger(ceph_subsys_osd);
16 }
17 }
18
19 namespace crimson::osd {
20
21 LogMissingRequestReply::LogMissingRequestReply(
22 crimson::net::ConnectionRef&& conn,
23 Ref<MOSDPGUpdateLogMissingReply> &&req)
24 : conn{std::move(conn)},
25 req{std::move(req)}
26 {}
27
28 void LogMissingRequestReply::print(std::ostream& os) const
29 {
30 os << "LogMissingRequestReply("
31 << "from=" << req->from
32 << " req=" << *req
33 << ")";
34 }
35
36 void LogMissingRequestReply::dump_detail(Formatter *f) const
37 {
38 f->open_object_section("LogMissingRequestReply");
39 f->dump_stream("rep_tid") << req->get_tid();
40 f->dump_stream("pgid") << req->get_spg();
41 f->dump_unsigned("map_epoch", req->get_map_epoch());
42 f->dump_unsigned("min_epoch", req->get_min_epoch());
43 f->dump_stream("from") << req->from;
44 f->close_section();
45 }
46
47 ConnectionPipeline &LogMissingRequestReply::get_connection_pipeline()
48 {
49 return get_osd_priv(conn.get()).replicated_request_conn_pipeline;
50 }
51
52 ClientRequest::PGPipeline &LogMissingRequestReply::pp(PG &pg)
53 {
54 return pg.request_pg_pipeline;
55 }
56
57 seastar::future<> LogMissingRequestReply::with_pg(
58 ShardServices &shard_services, Ref<PG> pg)
59 {
60 logger().debug("{}: LogMissingRequestReply::with_pg", *this);
61
62 IRef ref = this;
63 return interruptor::with_interruption([this, pg] {
64 return pg->do_update_log_missing_reply(std::move(req));
65 }, [ref](std::exception_ptr) { return seastar::now(); }, pg);
66 }
67
68 }