Skip to content

Commit 3d824b0

Browse files
authored
Correct the status of table runtime after ams restarted. (#4043)
1 parent fda105e commit 3d824b0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ public TableOptimizingProcess(
500500
if (processState.getToSequence() != null) {
501501
toSequence = processState.getToSequence();
502502
}
503+
this.status = processMeta.getStatus();
503504
if (this.status != ProcessStatus.KILLED) {
504505
tableRuntime.recover(this);
505506
}

amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableRuntime.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.amoro.optimizing.plan.AbstractOptimizingEvaluator;
3333
import org.apache.amoro.process.AmoroProcess;
3434
import org.apache.amoro.process.ProcessFactory;
35+
import org.apache.amoro.process.ProcessStatus;
3536
import org.apache.amoro.process.TableProcessStore;
3637
import org.apache.amoro.server.AmoroServiceConstants;
3738
import org.apache.amoro.server.optimizing.OptimizingProcess;
@@ -118,6 +119,9 @@ public void recover(OptimizingProcess optimizingProcess) {
118119
throw new IllegalStateException("Table runtime and processing are not matched!");
119120
}
120121
this.optimizingProcess = optimizingProcess;
122+
if (this.optimizingProcess.getStatus() == ProcessStatus.SUCCESS) {
123+
completeProcess(true);
124+
}
121125
}
122126

123127
@Override

0 commit comments

Comments
 (0)