dumpling在导出tidb集群单张表数据的时候中途报错:Error 1317: Query execution was interrupted

【 TiDB 使用环境】生产环境
【 TiDB 版本】v6.5.1
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
使用dumpling导出tidb集群数据的时候,导出中途会出现如下的报错:
[2024/10/22 03:12:40.299 +08:00] [INFO] [collector.go:221] [“backup failed summary”] [total-ranges=1] [ranges-succeed=0] [ranges-failed=1] [unit-name=“dump table data”] [error=“Error 1317: Query execution was interrupted”] [errorVerbose=“Error 1317: Query execution was interrupted\ngithub.com/pingcap/errors.AddStack\n\tgithub.com/pingcap/errors@v0.11.5-0.20220729040631-518f63d66278/errors.go:174\ngithub.com/pingcap/errors.Trace\n\tgithub.com/pingcap/errors@v0.11.5-0.20220729040631-518f63d66278/juju_adaptor.go:15\ngithub.com/pingcap/tidb/dumpling/export.(*rowIter).Error\n\tgithub.com/pingcap/tidb/dumpling/export/ir_impl.go:41\ngithub.com/pingcap/tidb/dumpling/export.WriteInsertInCsv\n\tgithub.com/pingcap/tidb/dumpling/export/writer_util.go:415\ngithub.com/pingcap/tidb/dumpling/export.FileFormat.WriteInsert\n\tgithub.com/pingcap/tidb/dumpling/export/writer_util.go:662\ngithub.com/pingcap/tidb/dumpling/export.(*Writer).tryToWriteTableData\n\tgithub.com/pingcap/tidb/dumpling/export/writer.go:239\ngithub.com/pingcap/tidb/dumpling/export.(*Writer).WriteTableData.func1\n\tgithub.com/pingcap/tidb/dumpling/export/writer.go:224\ngithub.com/pingcap/tidb/br/pkg/utils.WithRetry\n\tgithub.com/pingcap/tidb/br/pkg/utils/retry.go:52\ngithub.com/pingcap/tidb/dumpling/export.(*Writer).WriteTableData\n\tgithub.com/pingcap/tidb/dumpling/export/writer.go:192\ngithub.com/pingcap/tidb/dumpling/export.(*Writer).handleTask\n\tgithub.com/pingcap/tidb/dumpling/export/writer.go:115\ngithub.com/pingcap/tidb/dumpling/export.(*Writer).run\n\tgithub.com/pingcap/tidb/dumpling/export/writer.go:93\ngithub.com/pingcap/tidb/dumpling/export.(*Dumper).startWriters.func4\n\tgithub.com/pingcap/tidb/dumpling/export/dump.go:356\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\tgolang.org/x/sync@v0.1.0/errgroup/errgroup.go:75\nruntime.goexit\n\truntime/asm_amd64.s:1594”]
Error 1317: Query execution was interrupted

导出命令:
dumpling -h $sourceip -u root -p -P 4000 -F 256M --no-header --filetype csv --sql “select * from ${dbname}.${tablename}” -o $export_dir --output-filename-template "${dbname}.${tablename}.{{.Index}}

尝试不用–sql方式,直接导出表也是会出现相同的错误:
dumpling -h $sourceip -u root -p -P 4000 -F 256M --no-header --filetype csv -B ${dbname} -T ${dbname}.${tablename} -o $export_dir

表中的数据量大概是2800万,表字段256个字段

看起来是连接被中断了,有设置max_execution_time 吗

1 个赞

过防火墙等设备了,有时候会有问题

嗯嗯,是这个原因导致的,设置max_execution_time这个比较小,导致超过个这个时间被中断了

日志里已经提示了。执行超时了。超时时间调大一些再试试。

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。