Skip to content
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
6 changes: 5 additions & 1 deletion be/src/http/action/mini_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,11 @@ Status MiniLoadAction::_on_new_header(HttpRequest* req) {
}
auto timeout_it = params.find(TIMEOUT_KEY);
if (timeout_it != params.end()) {
ctx->timeout_second = std::stoi(timeout_it->second);
try {
ctx->timeout_second = std::stoi(timeout_it->second);
} catch (const std::invalid_argument& e) {
return Status::InvalidArgument("Invalid timeout format");
}
}

LOG(INFO) << "new income mini load request." << ctx->brief()
Expand Down
8 changes: 8 additions & 0 deletions be/src/http/action/stream_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ Status StreamLoadAction::_on_header(HttpRequest* http_req, StreamLoadContext* ct

TNetworkAddress master_addr = _exec_env->master_info()->network_address;

if (!http_req->header(HTTP_TIMEOUT).empty()) {
try {
ctx->timeout_second = std::stoi(http_req->header(HTTP_TIMEOUT));
} catch (const std::invalid_argument& e) {
return Status::InvalidArgument("Invalid timeout format");
}
}

// begin transaction
RETURN_IF_ERROR(_exec_env->stream_load_executor()->begin_txn(ctx));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的

导入任务的超时时间(以秒为单位),导入任务在设定的 timeout 时间内未完成则会被系统取消,变成 CANCELLED。

目前 Stream load 并不支持自定义导入的 timeout 时间,所有 Stream load 导入的超时时间是统一的,默认的 timeout 时间为300秒。如果导入的源文件无法再规定时间内完成导入,则需要调整 FE 的参数```stream_load_default_timeout_second```。
默认的 timeout 时间为 600 秒。如果导入的源文件无法再规定时间内完成导入,用户可以在 stream load 请求中设置单独的超时时间。

或者调整 FE 的参数```stream_load_default_timeout_second``` 来设置全局的默认超时时间。

### BE 配置

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
max_filter_ratio: 用于指定允许过滤不规范数据的最大比例,默认是0,不允许过滤
自定义指定应该如下:'max_filter_ratio=0.2',含义是允许20%的错误率

timeout: 指定 load 作业的超时时间,单位是秒。当load执行时间超过该阈值时,会自动取消。默认超时时间是 86400 秒。
timeout: 指定 load 作业的超时时间,单位是秒。当load执行时间超过该阈值时,会自动取消。默认超时时间是 600 秒。
建议指定 timeout 时间小于 86400 秒。

hll: 用于指定数据里面和表里面的HLL列的对应关系,表中的列和数据里面指定的列
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
partitions: 用于指定这次导入所设计的partition。如果用户能够确定数据对应的partition,推荐指定该项。不满足这些分区的数据将被过滤掉。
比如指定导入到p1, p2分区,-H "partitions: p1, p2"

timeout: 指定导入的超时时间。单位秒。默认是 600 秒。可设置范围为 1 秒 ~ 259200 秒。

RETURN VALUES
导入完成后,会以Json格式返回这次导入的相关内容。当前包括一下字段
Status: 导入最后的状态。
Expand All @@ -66,8 +68,8 @@

## example

1. 将本地文件'testData'中的数据导入到数据库'testDb'中'testTbl'的表,使用Label用于去重
curl --location-trusted -u root -H "label:123" -T testData http://host:port/api/testDb/testTbl/_stream_load
1. 将本地文件'testData'中的数据导入到数据库'testDb'中'testTbl'的表,使用Label用于去重。指定超时时间为 100 秒
curl --location-trusted -u root -H "label:123" -H "timeout:100" -T testData http://host:port/api/testDb/testTbl/_stream_load

2. 将本地文件'testData'中的数据导入到数据库'testDb'中'testTbl'的表,使用Label用于去重, 并且只导入k1等于20180601的数据
curl --location-trusted -u root -H "label:123" -H "where: k1=20180601" -T testData http://host:port/api/testDb/testTbl/_stream_load
Expand Down
2 changes: 1 addition & 1 deletion fe/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public class Config extends ConfigBase {
* Default stream load and streaming mini load timeout
*/
@ConfField(mutable = true, masterOnly = true)
public static int stream_load_default_timeout_second = 600; // 300s
public static int stream_load_default_timeout_second = 600; // 600s

/*
* Max load timeout applicable to all type of load
Expand Down