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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new a4906868062 [fix](migrate disk) fix tablet disk migration timeout too 
large (#29895) (#34063)
a4906868062 is described below

commit a49068680624d7752a7091208dd2d3de08e17ba2
Author: yujun <[email protected]>
AuthorDate: Wed Apr 24 21:30:44 2024 +0800

    [fix](migrate disk) fix tablet disk migration timeout too large (#29895) 
(#34063)
---
 be/src/common/config.cpp                           | 4 ++--
 be/src/common/config.h                             | 2 +-
 be/src/olap/task/engine_storage_migration_task.cpp | 4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 8440433b707..894b7e113d3 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -435,8 +435,8 @@ DEFINE_mInt32(finished_migration_tasks_size, "10000");
 // If size less than this, the remaining rowsets will be force to complete
 DEFINE_mInt32(migration_remaining_size_threshold_mb, "10");
 // If the task runs longer than this time, the task will be terminated, in 
seconds.
-// tablet max size / migration min speed * factor = 10GB / 1MBps * 2 = 20480 
seconds
-DEFINE_mInt32(migration_task_timeout_secs, "20480");
+// timeout = std::max(migration_task_timeout_secs,  tablet size / 1MB/s)
+DEFINE_mInt32(migration_task_timeout_secs, "300");
 
 // Port to start debug webserver on
 DEFINE_Int32(webserver_port, "8040");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index fcb501cb802..b2841b46f35 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -479,7 +479,7 @@ DECLARE_mInt32(finished_migration_tasks_size);
 // If size less than this, the remaining rowsets will be force to complete
 DECLARE_mInt32(migration_remaining_size_threshold_mb);
 // If the task runs longer than this time, the task will be terminated, in 
seconds.
-// tablet max size / migration min speed * factor = 10GB / 1MBps * 2 = 20480 
seconds
+// timeout = std::max(migration_task_timeout_secs,  tablet size / 1MB/s)
 DECLARE_mInt32(migration_task_timeout_secs);
 
 // Port to start debug webserver on
diff --git a/be/src/olap/task/engine_storage_migration_task.cpp 
b/be/src/olap/task/engine_storage_migration_task.cpp
index 6788cfcc019..f2896e05775 100644
--- a/be/src/olap/task/engine_storage_migration_task.cpp
+++ b/be/src/olap/task/engine_storage_migration_task.cpp
@@ -88,7 +88,9 @@ Status EngineStorageMigrationTask::_get_versions(int32_t 
start_version, int32_t*
 
 bool EngineStorageMigrationTask::_is_timeout() {
     int64_t time_elapsed = time(nullptr) - _task_start_time;
-    if (time_elapsed > config::migration_task_timeout_secs) {
+    int64_t timeout = std::max<int64_t>(config::migration_task_timeout_secs,
+                                        _tablet->tablet_local_size() >> 20);
+    if (time_elapsed > timeout) {
         LOG(WARNING) << "migration failed due to timeout, time_eplapsed=" << 
time_elapsed
                      << ", tablet=" << _tablet->full_name();
         return true;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to