Skip to content

Commit

Permalink
[AMORO-3365]The table is always in committing state
Browse files Browse the repository at this point in the history
throw IllegalStateException
  • Loading branch information
7hong committed Dec 16, 2024
1 parent 6ef1be7 commit 1c966fc
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.amoro.ServerTableIdentifier;
import org.apache.amoro.api.OptimizingTaskId;
import org.apache.amoro.exception.OptimizingClosedException;
import org.apache.amoro.exception.PersistenceException;
import org.apache.amoro.optimizing.MetricsSummary;
import org.apache.amoro.optimizing.OptimizingType;
import org.apache.amoro.optimizing.RewriteFilesInput;
Expand Down Expand Up @@ -564,7 +565,11 @@ public void commit() {
lock.lock();
try {
if (hasCommitted) {
LOG.warn("{} has already committed, give up", tableRuntime.getTableIdentifier());
LOG.warn(
"{} has already committed, give up, last error: {}",
tableRuntime.getTableIdentifier(),
failedReason);
persistProcessCompleted(status == ProcessStatus.SUCCESS);
throw new IllegalStateException("repeat commit, and last error " + failedReason);
}
try {
Expand All @@ -573,6 +578,11 @@ public void commit() {
status = ProcessStatus.SUCCESS;
endTime = System.currentTimeMillis();
persistProcessCompleted(true);
} catch (PersistenceException e) {
LOG.warn(
"{} failed to persist process completed, will retry next commit",
tableRuntime.getTableIdentifier(),
e);
} catch (Exception e) {
LOG.error("{} Commit optimizing failed ", tableRuntime.getTableIdentifier(), e);
status = ProcessStatus.FAILED;
Expand Down

0 comments on commit 1c966fc

Please sign in to comment.