kangpinghuang commented on a change in pull request #973: Delete tablet related 
txns when drop tablet
URL: https://github.com/apache/incubator-doris/pull/973#discussion_r276942253
 
 

 ##########
 File path: be/src/olap/txn_manager.cpp
 ##########
 @@ -359,6 +359,33 @@ void TxnManager::get_tablet_related_txns(TabletSharedPtr 
tablet, int64_t* partit
     }
 }
 
+// force drop all txns related with the tablet
+// maybe lock error, because not get txn lock before remove from meta
+void TxnManager::force_rollback_tablet_related_txns(OlapMeta* meta, TTabletId 
tablet_id, SchemaHash schema_hash) {
+    TabletInfo tablet_info(tablet_id, schema_hash);
+    WriteLock txn_wrlock(&_txn_map_lock);
+    for (auto& it : _txn_tablet_map) {
+        auto load_itr = it.second.find(tablet_info);
+        if (load_itr != it.second.end()) {
+            TabletTxnInfo& load_info = load_itr->second;
+            if (load_info.rowset != nullptr && meta != nullptr) {
 
 Review comment:
   move meta != nullptr to the line 365

----------------------------------------------------------------
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]

Reply via email to