Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement](backup-restore) add config for upload/download task num per be (#27772) #34019

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/en/docs/admin-manual/config/fe-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,26 @@ MasterOnly:true

default timeout of backup job

#### `backup_upload_task_num_per_be`

Default:3

IsMutable:true

MasterOnly:true

The max number of upload tasks assigned to each be during the backup process, the default value is 3.

#### `restore_download_task_num_per_be`

Default:3

IsMutable:true

MasterOnly:true

The max number of download tasks assigned to each be during the restore process, the default value is 3.

#### `max_backup_restore_job_num_per_db`

Default: 10
Expand Down
20 changes: 20 additions & 0 deletions docs/zh-CN/docs/admin-manual/config/fe-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2583,6 +2583,26 @@ SmallFileMgr 中存储的最大文件数

备份作业的默认超时时间

#### `backup_upload_task_num_per_be`

默认值:3

是否可以动态配置:true

是否为 Master FE 节点独有的配置项:true

备份过程中,分配给每个be的upload任务最大个数,默认值为3个。

#### `restore_download_task_num_per_be`

默认值:3

是否可以动态配置:true

是否为 Master FE 节点独有的配置项:true

恢复过程中,分配给每个be的download任务最大个数,默认值为3个。

#### `max_backup_restore_job_num_per_db`

默认值:10
Expand Down
12 changes: 12 additions & 0 deletions fe/fe-common/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,18 @@ public class Config extends ConfigBase {
+ "or too large package causing OOM,default 20000000(20M),set -1 for unlimited. "})
public static int fe_thrift_max_pkg_bytes = 20000000;

@ConfField(mutable = true, masterOnly = true, description = {
"备份过程中,分配给每个be的upload任务最大个数,默认值为3个。",
"The max number of upload tasks assigned to each be during the backup process, the default value is 3."
})
public static int backup_upload_task_num_per_be = 3;

@ConfField(mutable = true, masterOnly = true, description = {
"恢复过程中,分配给每个be的download任务最大个数,默认值为3个。",
"The max number of download tasks assigned to each be during the restore process, the default value is 3."
})
public static int restore_download_task_num_per_be = 3;

@ConfField(description = {"是否开启通过http接口获取log文件的功能",
"Whether to enable the function of getting log files through http interface"})
public static boolean enable_get_log_file_api = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.doris.catalog.Table;
import org.apache.doris.catalog.Tablet;
import org.apache.doris.catalog.View;
import org.apache.doris.common.Config;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.datasource.property.S3ClientBEProperties;
Expand Down Expand Up @@ -597,8 +598,7 @@ private void uploadSnapshot() {
for (Long beId : beToSnapshots.keySet()) {
List<SnapshotInfo> infos = beToSnapshots.get(beId);
int totalNum = infos.size();
// each backend allot at most 3 tasks
int batchNum = Math.min(totalNum, 3);
int batchNum = Math.min(totalNum, Config.backup_upload_task_num_per_be);
// each task contains several upload sub tasks
int taskNumPerBatch = Math.max(totalNum / batchNum, 1);
LOG.info("backend {} has {} batch, total {} tasks, {}", beId, batchNum, totalNum, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.apache.doris.catalog.TabletMeta;
import org.apache.doris.catalog.View;
import org.apache.doris.clone.DynamicPartitionScheduler;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.FeMetaVersion;
import org.apache.doris.common.MarkedCountDownLatch;
Expand Down Expand Up @@ -1347,8 +1348,7 @@ private void downloadRemoteSnapshots() {
for (Long beId : beToSnapshots.keySet()) {
List<SnapshotInfo> beSnapshotInfos = beToSnapshots.get(beId);
int totalNum = beSnapshotInfos.size();
// each backend allot at most 3 tasks
int batchNum = Math.min(totalNum, 3);
int batchNum = Math.min(totalNum, Config.restore_download_task_num_per_be);
// each task contains several upload sub tasks
int taskNumPerBatch = Math.max(totalNum / batchNum, 1);
LOG.debug("backend {} has {} batch, total {} tasks, {}",
Expand Down Expand Up @@ -1500,8 +1500,7 @@ private void downloadLocalSnapshots() {
for (Long beId : beToSnapshots.keySet()) {
List<SnapshotInfo> beSnapshotInfos = beToSnapshots.get(beId);
int totalNum = beSnapshotInfos.size();
// each backend allot at most 3 tasks
int batchNum = Math.min(totalNum, 3);
int batchNum = Math.min(totalNum, Config.restore_download_task_num_per_be);
// each task contains several upload sub tasks
int taskNumPerBatch = Math.max(totalNum / batchNum, 1);

Expand Down
Loading