【 TiDB 使用环境】TiDB V4.0.0 Dumpling V4.0.2
【概述】 使用Dumpling工具导出数据,大约执行了20多分钟后,发生错误,具体如下:
[mysql] 2022/01/19 11:05:34 packets.go:427: busy buffe
[mysql] 2022/01/19 11:05:35 packets.go:36: unexpected EOF
[2022/01/19 11:06:03.619 +08:00] [ERROR] [main.go:191] ["dump failed error stack info"] [error="SELECT * FROM `db_pr`.`db_order` WHERE (`id` >= 419858571988236251 AND `id` < 421896720395460626): invalid connection"] [errorVerbose="invalid connection\
SELECT * FROM db_pr
.db_order
WHERE (id
>= 419858571988236251 AND id
< 421896720395460626)"] [stack=“github.com/pingcap/log.Error
\t/go/pkg/mod/github.com/pingcap/log@v0.0.0-20200511115504-543df19646ad/global.go:42
main.main
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/cmd/dumpling/main.go:191
runtime.main
\t/usr/local/go/src/runtime/proc.go:203”]
dump failed: SELECT * FROM `db_pr`.`db_order` WHERE (`id` >= 419858571988236251 AND `id` < 421896720395460626): invalid connection
【备份和数据迁移策略逻辑】 Dumpling导出数据时命令行参数如下:
dumpling -u db_user -h 172.17.10.10 --filetype sql -t 8 -o /data/backup/ -r 200000 -F 256MiB
【背景】 查了下当前正在导的表大小为 42968831 行数据。
【现象】 Dumping 刚开始运行时,有提示警告如下:
{"level":"warn","ts":"2022-01-19T10:43:48.769+0800","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-018a32b6-7c67-49ca-a4ed-58cdf417d3d5/172.17.10.10:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = context deadline exceeded"}
[2022/01/19 10:43:48.769 +08:00] [WARN] [dump.go:57] ["meet error while check whether fetched pd addr and TiDB belongs to one cluster"] [error="context deadline exceeded"] [pdAddrs="[172.17.10.10:2379,172.17.10.89:2379,172.17.10.58:2379]"
[2022/01/19 10:43:48.769 +08:00] [WARN] [dump.go:95] ["If the amount of data to dump is large, criteria: (data more than 60GB or dumped time more than 10 minutes)\
you’d better adjust the tikv_gc_life_time to avoid export failure due to TiDB GC during the dump process.
Before dumping: run sql update mysql.tidb set VARIABLE_VALUE = '720h' where VARIABLE_NAME = 'tikv_gc_life_time';
in tidb.
After dumping: run sql update mysql.tidb set VARIABLE_VALUE = '10m' where VARIABLE_NAME = 'tikv_gc_life_time';
in tidb.
"]`
[2022/01/19 10:43:48.973 +08:00] [WARN] [block_allow_list.go:15] ["unsupported dump schema in TiDB now"] [schema=INFORMATION_SCHEMA]
[2022/01/19 10:43:48.973 +08:00] [WARN] [block_allow_list.go:15] ["unsupported dump schema in TiDB now"] [schema=PERFORMANCE_SCHEMA]
[2022/01/19 10:43:48.973 +08:00] [WARN] [block_allow_list.go:15] ["unsupported dump schema in TiDB now"] [schema=mysql]
[2022/01/19 10:43:48.973 +08:00] [WARN] [block_allow_list.go:15] ["unsupported dump schema in TiDB now"] [schema=METRICS_SCHEMA]
麻烦大佬给指点。
非常感谢