[fix](routine-load) fix data lost when FE leader change (#33678)

This commit is contained in:
HHoflittlefish777
2024-04-16 11:18:48 +08:00
committed by yiguolei
parent 53a3d6c154
commit dac2829194

View File

@ -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++;