From 2f7ca451c2e54287f1b2342e933e37e592780211 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 16 Mar 2018 14:57:27 -0500 Subject: [PATCH] osd/PrimaryLogPG: restore op_applied in PGBackend Call it when we queue the submitted write. For ReplicatedPG this is inside submit_transaction(), and for ECBackend it's when we finally submit the write for disk (possibly delayed by a read/modify/write). Signed-off-by: Sage Weil --- src/osd/ECBackend.cc | 1 + src/osd/PGBackend.h | 3 +++ src/osd/PrimaryLogPG.cc | 1 - src/osd/PrimaryLogPG.h | 2 +- src/osd/ReplicatedBackend.cc | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 3256d7b979d36..874727f1cf197 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -929,6 +929,7 @@ void ECBackend::handle_sub_write( tls.push_back(std::move(op.t)); tls.push_back(std::move(localt)); get_parent()->queue_transactions(tls, msg); + get_parent()->op_applied(op.at_version); } void ECBackend::handle_sub_read( diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 68da2e89b6fd0..c2967441b9366 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -216,6 +216,9 @@ typedef ceph::shared_ptr OSDMapRef; virtual void release_locks(ObcLockManager &manager) = 0; + virtual void op_applied( + const eversion_t &applied_version) = 0; + virtual bool should_send_op( pg_shard_t peer, const hobject_t &hoid) = 0; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index b5ac56aa28f6e..b9f41c71bf911 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10040,7 +10040,6 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) repop->rep_tid, ctx->reqid, ctx->op); - op_applied(ctx->at_version); } PrimaryLogPG::RepGather *PrimaryLogPG::new_repop( diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index d46af22543c67..dfa584b1ea396 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -414,7 +414,7 @@ public: append_log(logv, trim_to, roll_forward_to, t, transaction_applied); } - void op_applied(const eversion_t &applied_version); // remove me + void op_applied(const eversion_t &applied_version) override; bool should_send_op( pg_shard_t peer, diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index e786c5003313c..f1e333bb0839e 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -498,6 +498,7 @@ void ReplicatedBackend::submit_transaction( tls.push_back(std::move(op_t)); parent->queue_transactions(tls, op.op); + parent->op_applied(at_version); } void ReplicatedBackend::op_commit( -- 2.39.5