You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2023/04/27 12:21:28 UTC

[doris] branch master updated: [bugfix](txn_manager) use write lock to protect txn_tablet_map (#19161)

This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 95d91e7010 [bugfix](txn_manager) use write lock to protect txn_tablet_map (#19161)
95d91e7010 is described below

commit 95d91e70100f477f1c5ded7bb4eeb5db675f2841
Author: yixiutt <10...@users.noreply.github.com>
AuthorDate: Thu Apr 27 20:21:20 2023 +0800

    [bugfix](txn_manager) use write lock to protect txn_tablet_map (#19161)
---
 be/src/olap/txn_manager.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/olap/txn_manager.cpp b/be/src/olap/txn_manager.cpp
index 14f7451095..d43bf44444 100644
--- a/be/src/olap/txn_manager.cpp
+++ b/be/src/olap/txn_manager.cpp
@@ -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());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org