You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "dataroaring (via GitHub)" <gi...@apache.org> on 2023/04/27 11:00:53 UTC

[GitHub] [doris] dataroaring commented on a diff in pull request #19161: [bugfix](txn_manager) use write lock to protect txn_tablet_map

dataroaring commented on code in PR #19161:
URL: https://github.com/apache/doris/pull/19161#discussion_r1178986630


##########
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));

Review Comment:
   map_lock is used to protect the txn map while txn lock is used to protect txn. It seems that, here we should acquire map read lock and released. then acquire txn read lock?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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