[bugfix](txn_manager) use write lock to protect txn_tablet_map (#19161)

This commit is contained in:
yixiutt
2023-04-27 20:21:20 +08:00
committed by GitHub
parent 7cf1ffa0b4
commit 95d91e7010

View File

@ -172,7 +172,7 @@ void TxnManager::set_txn_related_delete_bitmap(
std::unique_lock<std::mutex> txn_lock(_get_txn_lock(transaction_id));
{
// get tx
std::shared_lock rdlock(_get_txn_map_lock(transaction_id));
std::lock_guard<std::shared_mutex> wrlock(_get_txn_map_lock(transaction_id));
txn_tablet_map_t& txn_tablet_map = _get_txn_tablet_map(transaction_id);
auto it = txn_tablet_map.find(key);
DCHECK(it != txn_tablet_map.end());