Skip to content

Commit

Permalink
[minor](log) add some log to observe the change of table's state. (ap…
Browse files Browse the repository at this point in the history
…ache#11448)

When upgrading to 1.x, some table's state may change to ROLLUP,
Resulting in not able to create/drop/modify partition.

I haven't find the root cause yet, so I add some log to observe
the change of table's state.
  • Loading branch information
morningman authored Aug 3, 2022
1 parent de44666 commit 1e59c40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,15 @@ public void replayAlterJobV2(AlterJobV2 alterJob) {
if (!alterJob.isDone()) {
addAlterJobV2ToTableNotFinalStateJobMap(alterJob);
changeTableStatus(alterJob.getDbId(), alterJob.getTableId(), OlapTableState.ROLLUP);
LOG.info("set table's state to ROLLUP, table id: {}, job id: {}", alterJob.getTableId(),
alterJob.getJobId());
} else if (removeAlterJobV2FromTableNotFinalStateJobMap(alterJob)) {
changeTableStatus(alterJob.getDbId(), alterJob.getTableId(), OlapTableState.NORMAL);
LOG.info("set table's state to NORMAL, table id: {}, job id: {}", alterJob.getTableId(),
alterJob.getJobId());
} else {
LOG.info("not set table's state, table id: {}, is job done: {}, job id: {}", alterJob.getTableId(),
alterJob.isDone(), alterJob.getJobId());
}
}

Expand Down Expand Up @@ -983,6 +990,11 @@ private void onJobDone(AlterJobV2 alterJob) {
removeJobFromRunningQueue(alterJob);
if (removeAlterJobV2FromTableNotFinalStateJobMap(alterJob)) {
changeTableStatus(alterJob.getDbId(), alterJob.getTableId(), OlapTableState.NORMAL);
LOG.info("set table's state to NORMAL, table id: {}, job id: {}", alterJob.getTableId(),
alterJob.getJobId());
} else {
LOG.info("not set table's state, table id: {}, is job done: {}, job id: {}", alterJob.getTableId(),
alterJob.isDone(), alterJob.getJobId());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ private void cancelInternal() {
tbl.deleteIndexInfo(shadowIndexName);
}
tbl.setState(OlapTableState.NORMAL);
LOG.info("set table's state to NORMAL when cancel job: {}", tbl.getId(), jobId);
} finally {
tbl.writeUnlock();
}
Expand Down

0 comments on commit 1e59c40

Please sign in to comment.