[fix](schema-change) Make sc job state updated after the table state is changed (#42670) (#43186)

pick: #42670
This commit is contained in:
Siyang Tang
2024-11-07 14:07:24 +08:00
committed by GitHub
parent 443e87e203
commit bbfed507da

View File

@ -591,14 +591,16 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
}
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);
// Drop table column stats after schema change finished.
Env.getCurrentEnv().getAnalysisManager().dropStats(tbl);
}