You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/01/03 02:37:11 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #7240: [Load] Transaction for load job with no data for all partitions should be considered as normal and should not be aborted

morningman commented on a change in pull request #7240:
URL: https://github.com/apache/incubator-doris/pull/7240#discussion_r777278929



##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/update/UpdateStmtExecutor.java
##########
@@ -177,21 +176,7 @@ private void executePlan() throws Exception {
 
     private void commitAndPublishTxn() throws UserException {
         GlobalTransactionMgr globalTransactionMgr = Catalog.getCurrentGlobalTransactionMgr();
-        // situation1: no data is updated, abort transaction
-        if (effectRows == 0) {
-            LOG.info("abort transaction for update stmt, query id:{}, reason: {}", DebugUtil.printId(queryId),
-                    TransactionCommitFailedException.NO_DATA_TO_LOAD_MSG);
-            globalTransactionMgr.abortTransaction(dbId, txnId, TransactionCommitFailedException.NO_DATA_TO_LOAD_MSG);
-            StringBuilder sb = new StringBuilder();
-            sb.append("{'label':'").append(label);
-            sb.append(", 'txnId':'").append(txnId).append("'");
-            sb.append(", 'queryId':'").append(DebugUtil.printId(queryId)).append("'");
-            sb.append("}");
-            analyzer.getContext().getState().setOk(effectRows, 0, sb.toString());
-            return;

Review comment:
       I remember that Doris do not support commit empty rowset. Have you tested this case yet?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/routineload/KafkaRoutineLoadJob.java
##########
@@ -240,16 +240,6 @@ protected boolean checkCommitInfo(RLTaskTxnCommitAttachment rlTaskTxnCommitAttac
             return true;
         }
 
-        if (txnStatusChangeReason != null && txnStatusChangeReason == TransactionState.TxnStatusChangeReason.NO_PARTITIONS) {
-            // Because the max_filter_ratio of routine load task is always 1.
-            // Therefore, under normal circumstances, routine load task will not return the error "too many filtered rows".
-            // If no data is imported, the error "all partitions have no load data" may only be returned.
-            // In this case, the status of the transaction is ABORTED,
-            // but we still need to update the offset to skip these error lines.
-            Preconditions.checkState(txnState.getTransactionStatus() == TransactionStatus.ABORTED, txnState.getTransactionStatus());
-            return true;

Review comment:
       We need to return true to skip those unloaded rows.




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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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