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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 48bb6ad0c5e [improve](restore) Log create replica task progress #42350 
(#42964)
48bb6ad0c5e is described below

commit 48bb6ad0c5e192e18627216a3f37b699d5916a5b
Author: walter <w41te...@gmail.com>
AuthorDate: Thu Oct 31 17:22:34 2024 +0800

    [improve](restore) Log create replica task progress #42350 (#42964)
    
    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 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