[improvement](MOW) use shared_lock when get load info in publish txn (#16874)
This commit is contained in:
@ -183,11 +183,9 @@ Status EnginePublishVersionTask::finish() {
|
||||
}
|
||||
}
|
||||
|
||||
VLOG_CRITICAL << "finish to publish version on transaction."
|
||||
<< "transaction_id=" << transaction_id
|
||||
<< ", cost(us): " << watch.get_elapse_time_us()
|
||||
<< ", error_tablet_size=" << _error_tablet_ids->size()
|
||||
<< ", res=" << res.to_string();
|
||||
LOG(INFO) << "finish to publish version on transaction."
|
||||
<< "transaction_id=" << transaction_id << ", cost(us): " << watch.get_elapse_time_us()
|
||||
<< ", error_tablet_size=" << _error_tablet_ids->size() << ", res=" << res.to_string();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -292,9 +292,9 @@ Status TxnManager::publish_txn(OlapMeta* meta, TPartitionId partition_id,
|
||||
RowsetSharedPtr rowset_ptr = nullptr;
|
||||
TabletTxnInfo* load_info = nullptr;
|
||||
{
|
||||
std::unique_lock<std::mutex> txn_lock(_get_txn_lock(transaction_id));
|
||||
{
|
||||
std::shared_lock rlock(_get_txn_map_lock(transaction_id));
|
||||
std::unique_lock<std::mutex> txn_rlock(_get_txn_lock(transaction_id));
|
||||
std::shared_lock txn_map_rlock(_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);
|
||||
if (it != txn_tablet_map.end()) {
|
||||
|
||||
Reference in New Issue
Block a user