This is an automated email from the ASF dual-hosted git repository. w41ter pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new a5efe1c66e0 [improve](restore) Log create replica task progress #42350 (#42967) a5efe1c66e0 is described below commit a5efe1c66e0d8a2917173ca2a156a21a006a2ac8 Author: walter <w41te...@gmail.com> AuthorDate: Thu Oct 31 14:36:34 2024 +0800 [improve](restore) Log create replica task progress #42350 (#42967) cherry pick from #42350 --- .../main/java/org/apache/doris/backup/RestoreJob.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java index 67120534f46..7a3ffabd050 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java @@ -945,11 +945,23 @@ public class RestoreJob extends AbstractJob { } // 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; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org