You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/04/26 11:04:42 UTC

[GitHub] [incubator-doris] kangpinghuang commented on a change in pull request #1047: dedup partitionid when clear txn

kangpinghuang commented on a change in pull request #1047:  dedup partitionid when clear txn
URL: https://github.com/apache/incubator-doris/pull/1047#discussion_r278902677
 
 

 ##########
 File path: be/src/olap/txn_manager.cpp
 ##########
 @@ -299,43 +302,43 @@ OLAPStatus TxnManager::delete_txn(OlapMeta* meta, TPartitionId partition_id, TTr
     WriteLock wrlock(_get_txn_lock(transaction_id));
     WriteLock txn_wrlock(&_txn_map_lock);
     auto it = _txn_tablet_map.find(key);
-    if (it != _txn_tablet_map.end()) {
-        auto load_itr = it->second.find(tablet_info);
-        if (load_itr != it->second.end()) {
-            // found load for txn,tablet
-            // case 1: user commit rowset, then the load id must be equal
-            TabletTxnInfo& load_info = load_itr->second;
-            if (load_info.rowset != nullptr && meta != nullptr) {
-                if (load_info.rowset->version().first > 0) { 
-                    LOG(WARNING) << "could not delete transaction from engine, "
-                                 << "just remove it from memory not delete from disk" 
-                                 << " because related rowset already published."
-                                 << ",partition_id: " << key.first
-                                 << ", transaction_id: " << key.second
-                                 << ", tablet: " << tablet_info.to_string()
-                                 << ", rowset id: " << load_info.rowset->rowset_id()
-                                 << ", version: " << load_info.rowset->version().first;
-                    return OLAP_ERR_TRANSACTION_ALREADY_VISIBLE;
-                } else {
-                    RowsetMetaManager::remove(meta, load_info.rowset->rowset_id());
-                    #ifndef BE_TEST
-                    StorageEngine::instance()->add_unused_rowset(load_info.rowset);
-                    #endif
-                }
+    if (it == _txn_tablet_map.end()) {
+        return OLAP_ERR_TRANSACTION_NOT_EXIST;
+    }
+    auto load_itr = it->second.find(tablet_info);
+    if (load_itr != it->second.end()) {
+        // found load for txn,tablet
+        // case 1: user commit rowset, then the load id must be equal
+        TabletTxnInfo& load_info = load_itr->second;
+        if (load_info.rowset != nullptr && meta != nullptr) {
+            if (load_info.rowset->version().first > 0) { 
+                LOG(WARNING) << "could not delete transaction from engine, "
+                                << "just remove it from memory not delete from disk" 
 
 Review comment:
   indent

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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