chaoyli commented on a change in pull request #2182: Sending clear txn task explicitly after transaction being aborted URL: https://github.com/apache/incubator-doris/pull/2182#discussion_r345181863
########## File path: be/src/olap/txn_manager.cpp ########## @@ -500,4 +514,32 @@ bool TxnManager::get_expire_txns(TTabletId tablet_id, SchemaHash schema_hash, Ta return true; } +void TxnManager::get_partition_ids(const TTransactionId transaction_id, std::vector<TPartitionId>* partition_ids) { + ReadLock txn_rdlock(&_txn_map_lock); + auto it = _txn_partition_map.find(transaction_id); + if (it != _txn_partition_map.end()) { + for(int64_t partition_id : it->second) { + partition_ids->push_back(partition_id); + } + } +} + +void TxnManager::_insert_txn_partition_map(int64_t transaction_id, int64_t partition_id) { + auto find = _txn_partition_map.find(transaction_id); + if (find == _txn_partition_map.end()) { + _txn_partition_map[transaction_id] = std::unordered_set<int64_t>(); + } + _txn_partition_map[transaction_id].insert(partition_id); +} + +void TxnManager::_clear_txn_partition_map(int64_t transaction_id, int64_t partition_id) { Review comment: _clear_txn_partition_map_unlock may be better? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org