Skip to content

Commit 522cc6c

Browse files
committed
crimson/osd/replicated_backend: Introduce pending_shart_t::last_complete
This will be used (next commit) once we'll call complete_write from ReplicatedBackend and not from PG as we do now. Signed-off-by: Matan Breizman <[email protected]> Signed-off-by: Xuehan Xu <[email protected]>
1 parent 551eb00 commit 522cc6c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/crimson/osd/replicated_backend.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ ReplicatedBackend::submit_transaction(
9292

9393
const ceph_tid_t tid = shard_services.get_tid();
9494
auto pending_txn =
95-
pending_trans.try_emplace(tid, pg_shards.size(), osd_op_p.at_version).first;
95+
pending_trans.try_emplace(
96+
tid,
97+
pg_shards.size(),
98+
osd_op_p.at_version,
99+
pg.get_last_complete()).first;
96100
bufferlist encoded_txn;
97101
encode(txn, encoded_txn);
98102

src/crimson/osd/replicated_backend.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ class ReplicatedBackend : public PGBackend
4444
const pg_shard_t whoami;
4545
class pending_on_t : public seastar::weakly_referencable<pending_on_t> {
4646
public:
47-
pending_on_t(size_t pending, const eversion_t& at_version)
48-
: pending{static_cast<unsigned>(pending)}, at_version(at_version)
47+
pending_on_t(
48+
size_t pending,
49+
const eversion_t& at_version,
50+
const eversion_t& last_complete)
51+
: pending{static_cast<unsigned>(pending)},
52+
at_version(at_version),
53+
last_complete(last_complete)
4954
{}
5055
unsigned pending;
5156
// The order of pending_txns' at_version must be the same as their
@@ -54,6 +59,7 @@ class ReplicatedBackend : public PGBackend
5459
// way, client requests at_version must be updated synchorously/simultaneously
5560
// with ceph_tid_t.
5661
const eversion_t at_version;
62+
const eversion_t last_complete;
5763
crimson::osd::acked_peers_t acked_peers;
5864
seastar::shared_promise<> all_committed;
5965
};

0 commit comments

Comments
 (0)