You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/09/25 04:27:45 UTC
[incubator-doris] branch master updated: [DOC] Add connection reset
exception solution (#6733)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new f3d4c47 [DOC] Add connection reset exception solution (#6733)
f3d4c47 is described below
commit f3d4c475b1f1bbad8a1a509d885d27312cbff292
Author: jiafeng.zhang <zh...@gmail.com>
AuthorDate: Sat Sep 25 12:27:35 2021 +0800
[DOC] Add connection reset exception solution (#6733)
Add solution for connection reset exception when doing stream load.
---
.../load-data/stream-load-manual.md | 27 +++++++++++++--
.../load-data/stream-load-manual.md | 40 ++++++++++++++++------
2 files changed, 54 insertions(+), 13 deletions(-)
diff --git a/docs/en/administrator-guide/load-data/stream-load-manual.md b/docs/en/administrator-guide/load-data/stream-load-manual.md
index bbf53ed..ab4bda2 100644
--- a/docs/en/administrator-guide/load-data/stream-load-manual.md
+++ b/docs/en/administrator-guide/load-data/stream-load-manual.md
@@ -63,6 +63,10 @@ Users submit import commands through HTTP protocol. If submitted to FE, FE forwa
The final result of the import is returned to the user by Coordinator BE.
+## Support data format
+
+Currently Stream Load supports two data formats: CSV (text) and JSON
+
## Basic operations
### Create a Load
@@ -104,7 +108,7 @@ Stream load uses HTTP protocol, so all parameters related to import tasks are se
+ column_separator
-
+
Used to specify the column separator in the load file. The default is `\t`. If it is an invisible character, you need to add `\x` as a prefix and hexadecimal to indicate the separator.
For example, the separator `\x01` of the hive file needs to be specified as `-H "column_separator:\x01"`.
@@ -112,7 +116,7 @@ Stream load uses HTTP protocol, so all parameters related to import tasks are se
You can use a combination of multiple characters as the column separator.
+ line_delimiter
-
+
Used to specify the line delimiter in the load file. The default is `\n`.
You can use a combination of multiple characters as the column separator.
@@ -328,4 +332,21 @@ Cluster situation: The concurrency of Stream load is not affected by cluster siz
To sort out the possible methods mentioned above: Search FE Master's log with Label to see if there are two ``redirect load action to destination = ``redirect load action to destination cases in the same Label. If so, the request is submitted repeatedly by the Client side.
- It is suggested that the user calculate the approximate import time according to the data quantity of the current request, and change the request time-out time of the Client end according to the import time-out time, so as to avoid the request being submitted by the Client end many times.
+ It is recommended that the user calculate the approximate import time based on the amount of data currently requested, and change the request overtime on the client side to a value greater than the import timeout time according to the import timeout time to avoid multiple submissions of the request by the client side.
+
+ 3. Connection reset abnormal
+
+ In the community version 0.14.0 and earlier versions, the connection reset exception occurred after Http V2 was enabled, because the built-in web container is tomcat, and Tomcat has pits in 307 (Temporary Redirect). There is a problem with the implementation of this protocol. All In the case of using Stream load to import a large amount of data, a connect reset exception will occur. This is because tomcat started data transmission before the 307 jump, which resulted in the lack of aut [...]
+
+ After the upgrade, also upgrade the http client version of your program to `4.5.13`,Introduce the following dependencies in your pom.xml file
+
+ ```xml
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.13</version>
+ </dependency>
+ ```
+
+
+
diff --git a/docs/zh-CN/administrator-guide/load-data/stream-load-manual.md b/docs/zh-CN/administrator-guide/load-data/stream-load-manual.md
index 2b22cdd..4bb0c08 100644
--- a/docs/zh-CN/administrator-guide/load-data/stream-load-manual.md
+++ b/docs/zh-CN/administrator-guide/load-data/stream-load-manual.md
@@ -63,6 +63,10 @@ Stream load 中,Doris 会选定一个节点作为 Coordinator 节点。该节
导入的最终结果由 Coordinator BE 返回给用户。
+## 支持数据格式
+
+目前 Stream Load 支持两个数据格式:CSV(文本) 和 JSON
+
## 基本操作
### 创建导入
@@ -103,7 +107,7 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
当 label 对应的导入作业状态为 CANCELLED 时,该 label 可以再次被使用。
+ column_separator
-
+
用于指定导入文件中的列分隔符,默认为\t。如果是不可见字符,则需要加\x作为前缀,使用十六进制来表示分隔符。
如hive文件的分隔符\x01,需要指定为-H "column_separator:\x01"。
@@ -111,11 +115,11 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
可以使用多个字符的组合作为列分隔符。
+ line_delimiter
-
+
用于指定导入文件中的换行符,默认为\n。
可以使用做多个字符的组合作为换行符。
-
+
+ max\_filter\_ratio
导入任务的最大容忍率,默认为0容忍,取值范围是0~1。当导入的错误率超过该值,则导入失败。
@@ -190,7 +194,7 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
|not null | 1 | 1 | true or false | correct data|
这里以列类型为 Decimal(1,0) 举例
-
+
>注:当表中的列允许导入空值时
|source data | source data example | string to int | strict_mode | result|
@@ -201,7 +205,7 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
|not null | 1 or 10 | 1 | true or false | correct data|
> 注意:10 虽然是一个超过范围的值,但是因为其类型符合 decimal的要求,所以 strict mode对其不产生影响。10 最后会在其他 ETL 处理流程中被过滤。但不会被 strict mode 过滤。
-
+
### 返回结果
@@ -236,9 +240,9 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
+ TxnId:导入的事务ID。用户可不感知。
+ Label:导入 Label。由用户指定或系统自动生成。
-
+
+ Status:导入完成状态。
-
+
"Success":表示导入成功。
"Publish Timeout":该状态也表示导入已经完成,只是数据可能会延迟可见,无需重试。
@@ -249,7 +253,7 @@ Stream load 由于使用的是 HTTP 协议,所以所有导入任务有关的
+ ExistingJobStatus:已存在的 Label 对应的导入作业的状态。
- 这个字段只有在当 Status 为 "Label Already Exists" 是才会显示。用户可以通过这个状态,知晓已存在 Label 对应的导入作业的状态。"RUNNING" 表示作业还在执行,"FINISHED" 表示作业成功。
+ 这个字段只有在当 Status 为 "Label Already Exists" 时才会显示。用户可以通过这个状态,知晓已存在 Label 对应的导入作业的状态。"RUNNING" 表示作业还在执行,"FINISHED" 表示作业成功。
+ Message:导入错误信息。
@@ -323,7 +327,7 @@ Stream load 的默认超时为 300秒,按照 Doris 目前最大的导入限速
例如:导入一个 10G 的文件
timeout = 1000s 等于 10G / 10M/s
```
-
+
### 完整例子
数据情况: 数据在发送导入请求端的本地磁盘路径 /home/store_sales 中,导入的数据量约为 15G,希望导入到数据库 bj_sales 的表 store_sales 中。
@@ -367,7 +371,23 @@ timeout = 1000s 等于 10G / 10M/s
排查上述可能的方法:使用 Label 搜索 FE Master 的日志,看是否存在同一个 Label 出现了两次 ```redirect load action to destination= ``` 的情况。如果有就说明,请求被 Client 端重复提交了。
- 建议用户根据当前请求的数据量,计算出大致导入的时间,并根据导入超时时间改大 Client 端的请求超时时间,避免请求被 Client 端多次提交。
+ 建议用户根据当前请求的数据量,计算出大致导入的时间,并根据导入超时时间,将Client 端的请求超时间改成大于导入超时时间的值,避免请求被 Client 端多次提交。
+
+ 3. Connection reset 异常
+
+ 在社区版 0.14.0 及之前的版本在启用Http V2之后出现connection reset异常,因为Web 容器内置的是tomcat,Tomcat 在 307 (Temporary Redirect) 是有坑的,对这个协议实现是有问题的,所有在使用Stream load 导入大数据量的情况下会出现connect reset异常,这个是因为tomcat在做307跳转之前就开始了数据传输,这样就造成了BE收到的数据请求的时候缺少了认证信息,之后将内置容器改成了Jetty解决了这个问题,如果你遇到这个问题,请升级你的Doris或者禁用Http V2(`enable_http_server_v2=false`)。
+
+ 升级以后同时升级你程序的http client 版本到 `4.5.13`,在你的pom.xml文件中引入下面的依赖
+
+ ```xml
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.5.13</version>
+ </dependency>
+ ```
+
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org