Skip to content

Commit

Permalink
[AMORO-2244] fix 0.4.x Failed optimizing tasks should not change to…
Browse files Browse the repository at this point in the history
… `Prepared` (#2245)

1.check task status to be Init/Executing when on prepared
2.change delete file log from DEBUG to INFO
  • Loading branch information
wangtaohz authored Nov 6, 2023
1 parent bb38fb5 commit 1559b95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public void onPrepared(long preparedTime, List<ByteBuffer> targetFiles, long new
long reportTime = System.currentTimeMillis();
lock.lock();
try {
Preconditions.checkArgument(optimizeRuntime.getStatus() != OptimizeStatus.Prepared,
"task prepared, can't on prepared");
// Some tasks may not need to be executed, these tasks can change to Prepared from Init directly
Preconditions.checkArgument(
optimizeRuntime.getStatus() == OptimizeStatus.Init || optimizeRuntime.getStatus() == OptimizeStatus.Executing,
optimizeRuntime.getStatus() + " task can't on prepared, only support Init or Executing");
OptimizeTaskRuntime newRuntime = optimizeRuntime.clone();
if (newRuntime.getExecuteTime() == OptimizeTaskRuntime.INVALID_TIME) {
newRuntime.setExecuteTime(preparedTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ private void addIntoOptimizeQueue(OptimizeTaskItem task) throws InvalidObjectExc
String pattern = ".*(\\d{5}-)" + task.getOptimizeRuntime().getAttemptId() + "(-\\d{10}).*";
if (Pattern.matches(pattern, fileLocation)) {
arcticTable.io().deleteFile(fileLocation);
LOG.debug("delete file {} by produced failed optimize task.", fileLocation);
LOG.info("delete file {} by produced failed optimize task.", fileLocation);
}
}
}
Expand Down

0 comments on commit 1559b95

Please sign in to comment.