diff --git a/fe/fe-core/src/main/java/com/starrocks/transaction/OlapTableTxnLogApplier.java b/fe/fe-core/src/main/java/com/starrocks/transaction/OlapTableTxnLogApplier.java index c749424d02338..f3f1c05e3374c 100644 --- a/fe/fe-core/src/main/java/com/starrocks/transaction/OlapTableTxnLogApplier.java +++ b/fe/fe-core/src/main/java/com/starrocks/transaction/OlapTableTxnLogApplier.java @@ -119,6 +119,8 @@ public void applyVisibleLog(TransactionState txnState, TableCommitInfo commitInf for (Tablet tablet : index.getTablets()) { boolean hasFailedVersion = false; List replicas = ((LocalTablet) tablet).getImmutableReplicas(); + boolean isDependencyReplicasNotCommited = txnState. + checkTransactionDependencyReplicasNotCommited((LocalTablet) tablet, quorumReplicaNum); for (Replica replica : replicas) { if (txnState.isNewFinish()) { updateReplicaVersion(version, replica, txnState.getFinishState()); @@ -130,9 +132,7 @@ public void applyVisibleLog(TransactionState txnState, TableCommitInfo commitInf if (!txnState.tabletCommitInfosContainsReplica(tablet.getId(), replica.getBackendId(), replica.getState()) || errorReplicaIds.contains(replica.getId())) { - if (txnState. - checkTransactionDependencyReplicasNotCommited((LocalTablet) tablet, quorumReplicaNum) - && replica.getVersion() >= version + if (isDependencyReplicasNotCommited && replica.getVersion() >= version && replica.getState() == Replica.ReplicaState.DECOMMISSION) { // this means the replica is a normal replica // success version always move forward