morningman commented on a change in pull request #3222: Support sharding
txn_map_lock into more small map locks to make good performance for txn manage
task
URL: https://github.com/apache/incubator-doris/pull/3222#discussion_r400945083
##########
File path: be/src/olap/txn_manager.cpp
##########
@@ -253,11 +260,11 @@ OLAPStatus TxnManager::publish_txn(OlapMeta* meta,
TPartitionId partition_id, TT
pair<int64_t, int64_t> key(partition_id, transaction_id);
TabletInfo tablet_info(tablet_id, schema_hash, tablet_uid);
RowsetSharedPtr rowset_ptr = nullptr;
- WriteLock wrlock(_get_txn_lock(transaction_id));
Review comment:
I think you may not be able to remove this lock.
`WriteLock wrlock(_get_txn_lock(transaction_id));`
The meaning of this lock is different from that of the `_txn_map_lock`. This
lock prevents a single transaction from being modified at the same time. The
`_txn_map_lock` prevents the map structure from being modified at the same time.
If this lock is removed here. Then there may be two threads publishing the
txn at the same time, which will modify their contents(such as rowset meta) at
the same time.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]