From 7fd15823622fcc78e6dc3181b45490b4eb293bb0 Mon Sep 17 00:00:00 2001 From: Harbor Liu <460660596@qq.com> Date: Fri, 20 Sep 2024 17:39:47 +0800 Subject: [PATCH] [BugFix] Fix stream load with no-2pc mistake write prepare edit log bug (#51039) --- .../com/starrocks/transaction/DatabaseTransactionMgr.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/transaction/DatabaseTransactionMgr.java b/fe/fe-core/src/main/java/com/starrocks/transaction/DatabaseTransactionMgr.java index 50cf33768913b..70a6313c2eaaf 100644 --- a/fe/fe-core/src/main/java/com/starrocks/transaction/DatabaseTransactionMgr.java +++ b/fe/fe-core/src/main/java/com/starrocks/transaction/DatabaseTransactionMgr.java @@ -363,8 +363,9 @@ public void prepareTransaction(long transactionId, List tablet // after state transform transactionState.afterStateTransform(TransactionStatus.PREPARED, txnOperated, callback, null); } - - persistTxnStateInTxnLevelLock(transactionState); + if (writeEditLog) { + persistTxnStateInTxnLevelLock(transactionState); + } LOG.info("transaction:[{}] successfully prepare", transactionState); } finally {