This is an automated email from the ASF dual-hosted git repository.

w41ter pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ea95b8c0720 [improve](restore) Log create replica task progress 
(#42350)
ea95b8c0720 is described below

commit ea95b8c07202ddbac65664fb7df2df13df0907fb
Author: walter <w41te...@gmail.com>
AuthorDate: Thu Oct 24 14:19:11 2024 +0800

    [improve](restore) Log create replica task progress (#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 f2ce3859c4d..94df414a96c 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
@@ -966,11 +966,23 @@ public class RestoreJob extends AbstractJob implements 
GsonPostProcessable {
             }
 
             // 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

Reply via email to