Skip to content

Commit

Permalink
[fix](schema-change) Make sc job state updated after the table state …
Browse files Browse the repository at this point in the history
…is changed (apache#42670) (apache#43186)

pick: apache#42670
  • Loading branch information
TangSiyang2001 authored Nov 7, 2024
1 parent 443e87e commit bbfed50
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,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);

// Drop table column stats after schema change finished.
Env.getCurrentEnv().getAnalysisManager().dropStats(tbl);
}
Expand Down

0 comments on commit bbfed50

Please sign in to comment.