]> git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/osd/replicated_backend.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / crimson / osd / replicated_backend.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 <boost/intrusive_ptr.hpp>
7 #include <seastar/core/future.hh>
8 #include "include/buffer_fwd.h"
9 #include "osd/osd_types.h"
10
11 #include "acked_peers.h"
12 #include "pg_backend.h"
13
14 namespace crimson::osd {
15 class ShardServices;
16 }
17
18 class ReplicatedBackend : public PGBackend
19 {
20 public:
21 ReplicatedBackend(pg_t pgid, pg_shard_t whoami,
22 CollectionRef coll,
23 crimson::osd::ShardServices& shard_services);
24 void got_rep_op_reply(const MOSDRepOpReply& reply) final;
25 private:
26 ll_read_errorator::future<ceph::bufferlist> _read(const hobject_t& hoid,
27 uint64_t off,
28 uint64_t len,
29 uint32_t flags) override;
30 seastar::future<crimson::osd::acked_peers_t>
31 _submit_transaction(std::set<pg_shard_t>&& pg_shards,
32 const hobject_t& hoid,
33 ceph::os::Transaction&& txn,
34 osd_reqid_t req_id,
35 epoch_t min_epoch, epoch_t max_epoch,
36 eversion_t ver) final;
37 const pg_t pgid;
38 const pg_shard_t whoami;
39 crimson::osd::ShardServices& shard_services;
40 ceph_tid_t next_txn_id = 0;
41 struct pending_on_t {
42 pending_on_t(size_t pending)
43 : pending{static_cast<unsigned>(pending)}
44 {}
45 unsigned pending;
46 crimson::osd::acked_peers_t acked_peers;
47 seastar::promise<> all_committed;
48 };
49 using pending_transactions_t = std::map<ceph_tid_t, pending_on_t>;
50 pending_transactions_t pending_trans;
51 };