From 2bdb98212004210d8078417f0484096952abd23d Mon Sep 17 00:00:00 2001 From: edwinhzhang Date: Sun, 24 Nov 2024 22:33:18 +0800 Subject: [PATCH] fix bug Signed-off-by: edwinhzhang --- .../com/starrocks/transaction/OlapTableTxnLogApplier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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