[Improvement](restore) make timeout of restore job's dispatching task progress configuable (#17434)

when a restore job which has a plenty of replicas, it may fail due to timeout. The error message is:
[RestoreJob.checkAndPrepareMeta():782] begin to send create replica tasks to BE for restore. total 381344 tasks. timeout: 600000

Currently, the max value of timeout is fixed, it's not suitable for such cases.
This commit is contained in:
Yulei-Yang
2023-03-06 10:05:31 +08:00
committed by GitHub
parent a8f20eb4ac
commit 56a3ead2d7

View File

@ -782,9 +782,9 @@ public class RestoreJob extends AbstractJob {
}
AgentTaskExecutor.submit(batchTask);
// estimate timeout, at most 10 min
// estimate timeout
long timeout = Config.tablet_create_timeout_second * 1000L * batchTask.getTaskNum();
timeout = Math.min(10 * 60 * 1000, timeout);
timeout = Math.min(timeout, Config.max_create_table_timeout_second * 1000);
try {
LOG.info("begin to send create replica tasks to BE for restore. total {} tasks. timeout: {}",
batchTask.getTaskNum(), timeout);