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
  • Loading branch information
rfyu authored Sep 14, 2024
1 parent 9877c20 commit 292111f
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 @@ -188,13 +188,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 292111f

Please sign in to comment.