From 5f495290a1085e477487d7cb3d1b62c2a26bb49b Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Wed, 4 Nov 2020 10:13:13 +0800 Subject: [PATCH] crimson/osd: reset pending_txn's all_committed after set its value Signed-off-by: Xuehan Xu --- src/crimson/osd/replicated_backend.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/crimson/osd/replicated_backend.cc b/src/crimson/osd/replicated_backend.cc index 3bde1e9d6f2..3a131278b0c 100644 --- a/src/crimson/osd/replicated_backend.cc +++ b/src/crimson/osd/replicated_backend.cc @@ -90,10 +90,11 @@ ReplicatedBackend::_submit_transaction(std::set&& pg_shards, } if (--peers->pending == 0) { peers->all_committed.set_value(); + peers->all_committed = {}; + return seastar::now(); } return peers->all_committed.get_future(); }).then([pending_txn, this] { - pending_txn->second.all_committed = {}; auto acked_peers = std::move(pending_txn->second.acked_peers); pending_trans.erase(pending_txn); return seastar::make_ready_future(std::move(acked_peers)); @@ -122,7 +123,8 @@ void ReplicatedBackend::got_rep_op_reply(const MOSDRepOpReply& reply) if (peer.shard == reply.from) { peer.last_complete_ondisk = reply.get_last_complete_ondisk(); if (--peers.pending == 0) { - peers.all_committed.set_value(); + peers.all_committed.set_value(); + peers.all_committed = {}; } return; } -- 2.39.5