Skip to content

Commit

Permalink
[AMORO-3111]Avoid optimization state blocking in planning (#3115)
Browse files Browse the repository at this point in the history
* Avoid optimization state blocking in planning

* modify the optimizing status in memory

* fix conflict and rollback configuration

(cherry picked from commit 292111f)
Signed-off-by: zhoujinsong <zhoujinsong0505@163.com>
  • Loading branch information
rfyu authored and zhoujinsong committed Oct 11, 2024
1 parent a13a95e commit 64ac2a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ private void triggerAsyncPlanning(
CompletableFuture.supplyAsync(() -> planInternal(tableRuntime), planExecutor)
.whenComplete(
(process, throwable) -> {
if (throwable != null) {
LOG.error("Failed to plan table {}", tableRuntime.getTableIdentifier(), throwable);
}
long currentTime = System.currentTimeMillis();
scheduleLock.lock();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,21 @@ public void beginPlanning() {
}

public void planFailed() {
invokeConsistency(
() -> {
OptimizingStatus originalStatus = optimizingStatus;
updateOptimizingStatus(OptimizingStatus.PENDING);
persistUpdatingRuntime();
tableHandler.handleTableChanged(this, originalStatus);
});
try {
invokeConsistency(
() -> {
OptimizingStatus originalStatus = optimizingStatus;
updateOptimizingStatus(OptimizingStatus.PENDING);
persistUpdatingRuntime();
tableHandler.handleTableChanged(this, originalStatus);
});
} catch (Exception e) {
OptimizingStatus originalStatus = optimizingStatus;
updateOptimizingStatus(OptimizingStatus.PENDING);
LOG.warn(
"Persistent database failed, only the optimizing state in the memory was changed.", e);
tableHandler.handleTableChanged(this, originalStatus);
}
}

public void beginProcess(OptimizingProcess optimizingProcess) {
Expand Down

0 comments on commit 64ac2a7

Please sign in to comment.