Skip to content

Commit

Permalink
[improve](restore) Log create replica task progress
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter committed Oct 23, 2024
1 parent 1c58147 commit a796780
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,23 @@ private void checkAndPrepareMeta() {
}

// estimate timeout
long timeout = DbUtil.getCreateReplicasTimeoutMs(numBatchTasks);
long timeout = DbUtil.getCreateReplicasTimeoutMs(numBatchTasks) / 1000;
try {
LOG.info("begin to send create replica tasks to BE for restore. total {} tasks. timeout: {}",
LOG.info("begin to send create replica tasks to BE for restore. total {} tasks. timeout: {}s",
numBatchTasks, timeout);
ok = latch.await(timeout, TimeUnit.MILLISECONDS);
for (long elapsed = 0; elapsed <= timeout; elapsed++) {
if (latch.await(1, TimeUnit.SECONDS)) {
ok = true;
break;
}
if (state != RestoreJobState.PENDING) { // user cancelled
return;
}
if (elapsed % 5 == 0) {
LOG.info("waiting {} create replica tasks for restore to finish, total {} tasks, elapsed {}s",
latch.getCount(), numBatchTasks, elapsed);
}
}
} catch (InterruptedException e) {
LOG.warn("InterruptedException: ", e);
ok = false;
Expand Down

0 comments on commit a796780

Please sign in to comment.