From dac2829194589c39d745decf89a881d8a75c79c4 Mon Sep 17 00:00:00 2001 From: HHoflittlefish777 <77738092+HHoflittlefish777@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:18:48 +0800 Subject: [PATCH] [fix](routine-load) fix data lost when FE leader change (#33678) --- .../org/apache/doris/load/routineload/RoutineLoadJob.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java b/fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java index 233d05d28b..8c8dd7eaad 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java @@ -1250,7 +1250,13 @@ public abstract class RoutineLoadJob extends AbstractTxnStateChangeCallback impl @Override public void replayOnAborted(TransactionState txnState) { // attachment may be null if this task is aborted by FE - if (txnState.getTxnCommitAttachment() != null) { + // it need check commit info before update progress + // for follower FE node progress may exceed correct progress + // the data will lost if FE leader change at this moment + if (txnState.getTxnCommitAttachment() != null + && checkCommitInfo((RLTaskTxnCommitAttachment) txnState.getTxnCommitAttachment(), + txnState, + TransactionState.TxnStatusChangeReason.fromString(txnState.getReason()))) { replayUpdateProgress((RLTaskTxnCommitAttachment) txnState.getTxnCommitAttachment()); } this.jobStatistic.abortedTaskNum++;