From 97e709b3041033828f98a85c75569be7cfc55ecb Mon Sep 17 00:00:00 2001 From: Eddy Ashton Date: Tue, 12 Nov 2024 16:37:40 +0000 Subject: [PATCH] Take `version_lock` when creating reserved Tx (#6633) Co-authored-by: Amaury Chamayou --- src/kv/store.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/kv/store.h b/src/kv/store.h index e1789e4ef663..08519ac6d0db 100644 --- a/src/kv/store.h +++ b/src/kv/store.h @@ -1255,8 +1255,7 @@ namespace ccf::kv ReservedTx create_reserved_tx(const TxID& tx_id) { - // version_lock should already been acquired in case term_of_last_version - // is incremented. + std::lock_guard vguard(version_lock); return ReservedTx(this, term_of_last_version, tx_id, rollback_count); }