From c19e35116bbd2223efd57f02b612ebea08bb3667 Mon Sep 17 00:00:00 2001 From: YueW <45946325+Tanya-W@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:54:05 +0800 Subject: [PATCH] [fix](inverted index)fix transaction id not unique for one index change job when light index change (#21180) --- .../src/main/java/org/apache/doris/alter/IndexChangeJob.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/IndexChangeJob.java b/fe/fe-core/src/main/java/org/apache/doris/alter/IndexChangeJob.java index d1293484cb..fecfe4b99b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/alter/IndexChangeJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/alter/IndexChangeJob.java @@ -124,6 +124,8 @@ public class IndexChangeJob implements Writable { this.createTimeMs = System.currentTimeMillis(); this.jobState = JobState.WAITING_TXN; + this.watershedTxnId = Env.getCurrentGlobalTransactionMgr() + .getTransactionIDGenerator().getNextTransactionId(); } public long getJobId() { @@ -243,8 +245,6 @@ public class IndexChangeJob implements Writable { protected void runWaitingTxnJob() throws AlterCancelException { Preconditions.checkState(jobState == JobState.WAITING_TXN, jobState); - this.watershedTxnId = Env.getCurrentGlobalTransactionMgr() - .getTransactionIDGenerator().getNextTransactionId(); try { if (!isPreviousLoadFinished()) { LOG.info("wait transactions before {} to be finished, inverted index job: {}", watershedTxnId, jobId);