chaoyli commented on a change in pull request #536: Add Rowset and 
RowsetBuilder for PushHandler
URL: https://github.com/apache/incubator-doris/pull/536#discussion_r249742246
 
 

 ##########
 File path: be/src/olap/push_handler.cpp
 ##########
 @@ -54,10 +57,59 @@ OLAPStatus PushHandler::process_realtime_push(
 
     OLAPStatus res = OLAP_SUCCESS;
     _request = request;
-    vector<TabletVars> tablet_infos(1);
-    tablet_infos[0].tablet = tablet;
-    AlterTabletType alter_tablet_type;
+    vector<TabletVars> tablet_vars(1);
+    tablet_vars[0].tablet = tablet;
+    res = _do_streaming_ingestion(tablet, request, push_type, &tablet_vars, 
tablet_info_vec);
+    // if transaction existed in engine but push not finished, not report to fe
+    if (res == OLAP_ERR_PUSH_TRANSACTION_ALREADY_EXIST) {
+        LOG(WARNING) << "find transaction existed when realtime push, not 
report. "
+                     << "[tablet=" << tablet->full_name()
+                     << " partition_id=" << request.partition_id
+                     << "transaction_id=" << request.transaction_id << "]";
+        return res;
+    }
+
+    if (res == OLAP_SUCCESS) {
+        if (tablet_info_vec != NULL) {
+            _get_tablet_infos(tablet_vars, tablet_info_vec);
+        }
+        LOG(INFO) << "process realtime push successfully. "
+                  << "tablet=" << tablet->full_name()
+                  << ", partition_id=" << request.partition_id
+                  << ", transaction_id=" << request.transaction_id;
+    } else {
 
+        // error happens, clear
+        LOG(WARNING) << "failed to process realtime push."
+                     << " table=" << tablet->full_name()
+                     << "transaction_id=" << request.transaction_id;
+        for (TabletVars& tablet_var : tablet_vars) {
+            if (tablet_var.tablet.get() == NULL) {
+                continue;
+            }
+
+            StorageEngine::get_instance()->delete_transaction(
 
 Review comment:
   instance(), delete_txn()

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: dev-unsubscr...@doris.apache.org
For additional commands, e-mail: dev-h...@doris.apache.org

Reply via email to