From f326e8fca5d853d1222b67e51070adf430011a08 Mon Sep 17 00:00:00 2001 From: tsy Date: Tue, 29 Oct 2024 10:33:54 +0800 Subject: [PATCH] [fix](schema-change) Make sc job state updated after the table state is changed --- .../java/org/apache/doris/alter/SchemaChangeJobV2.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java index 559442b75f827f..1c6e9d4451b4c0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java +++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeJobV2.java @@ -667,14 +667,16 @@ protected void runRunningJob() throws AlterCancelException { } pruneMeta(); - this.jobState = JobState.FINISHED; - this.finishedTimeMs = System.currentTimeMillis(); - Env.getCurrentEnv().getEditLog().logAlterJob(this); LOG.info("schema change job finished: {}", jobId); changeTableState(dbId, tableId, OlapTableState.NORMAL); LOG.info("set table's state to NORMAL, table id: {}, job id: {}", tableId, jobId); + + this.jobState = JobState.FINISHED; + this.finishedTimeMs = System.currentTimeMillis(); + Env.getCurrentEnv().getEditLog().logAlterJob(this); + postProcessOriginIndex(); // Drop table column stats after schema change finished. Env.getCurrentEnv().getAnalysisManager().dropStats(tbl, null);