[fix](schema-change) Fix job replay failure when partitions added to table after job finish (#46166) (#46367)

Cherry-picked from #46166
This commit is contained in:
Siyang Tang
2025-01-03 19:25:43 +08:00
committed by GitHub
parent ff68859546
commit c2a17b8ad9

View File

@ -586,21 +586,21 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
} // end for partitions
// all partitions are good
onFinished(tbl);
pruneMeta();
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);
} finally {
tbl.writeUnlock();
}
pruneMeta();
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);
}