dumpling导出mysql中某张表一直卡住没反应

我这张表有10003行,1680MB大小一直卡在
[2022/09/02 10:32:54.290 +08:00] [INFO] [config.go:617] ["detect server version"] [version=5.7.39-log]

下面是我的dumpling导出语句

[root@k8s-node23 my_database]# tiup dumpling:v4.0.9 -h 192.168.xxx.xx -P 3306 -u xxx -p xxx -t 8 -r 200000 -F 256MB -T gdelt.news_webpages -o /data/my_database/
Starting component `dumpling`: /root/.tiup/components/dumpling/v4.0.9/dumpling -h 192.168.99.24 -P 3306 -u root -p CNdsdis123 -t 8 -r 200000 -F 256MB -T gdelt.news_webpages -o /data/my_database/
Release version: v4.0.9
Git commit hash: 11d8d5dad31210a1ec6afef9d3c16b397f2fc9fb
Git branch:      heads/refs/tags/v4.0.9
Build timestamp: 2020-12-19 04:53:02Z
Go version:      go version go1.13 linux/amd64

[2022/09/02 10:32:54.290 +08:00] [INFO] [config.go:598] ["detect server type"] [type=MySQL]
[2022/09/02 10:32:54.290 +08:00] [INFO] [config.go:617] ["detect server version"] [version=5.7.39-log]
# 一直卡在这里  后面就没有任何信息了

求助各位大佬。

现在过了20多分钟,现在提示这个信息。

[2022/09/02 10:47:54.292 +08:00] [ERROR] [main.go:74] ["dump failed error stack info"] [error="sql: FLUSH TABLES WITH READ LOCK: invalid connection"] [errorVerbose="invalid connection\nsql: FLUSH TABLES WITH READ LOCK\ngithub.com/pingcap/dumpling/v4/export.FlushTableWithReadLock\n\tgithub.com/pingcap/dumpling@/v4/export/sql.go:398\ngithub.com/pingcap/dumpling/v4/export.(*ConsistencyFlushTableWithReadLock).Setup\n\tgithub.com/pingcap/dumpling@/v4/export/consistency.go:86\ngithub.com/pingcap/dumpling/v4/export.(*Dumper).Dump\n\tgithub.com/pingcap/dumpling@/v4/export/dump.go:104\nmain.main\n\tgithub.com/pingcap/dumpling@/cmd/dumpling/main.go:71\nruntime.main\n\truntime/proc.go:203\nruntime.goexit\n\truntime/asm_amd64.s:1357"] [stack="main.main\n\tgithub.com/pingcap/dumpling@/cmd/dumpling/main.go:74\nruntime.main\n\truntime/proc.go:203"]

dump failed: sql: FLUSH TABLES WITH READ LOCK: invalid connection

加上 --loglevel debug 再跑一下看看?

加了debug模式也是卡住,没有任何日志

base/ --loglevel debug
Release version: v4.0.9
Git commit hash: 11d8d5dad31210a1ec6afef9d3c16b397f2fc9fb
Git branch:      heads/refs/tags/v4.0.9
Build timestamp: 2020-12-19 04:53:02Z
Go version:      go version go1.13 linux/amd64

[2022/09/02 12:07:24.154 +08:00] [DEBUG] [config.go:584] ["parse server info"] ["server info string"=5.7.39-log]
[2022/09/02 12:07:24.154 +08:00] [INFO] [config.go:598] ["detect server type"] [type=MySQL]
[2022/09/02 12:07:24.154 +08:00] [INFO] [config.go:617] ["detect server version"] [version=5.7.39-log]

我换成6.2.0的版本,现在有一些信息,但是还是卡住不动。

base/ --loglevel debug
Release version: v6.2.0
Git commit hash: daf2b17cdfe30c02ce282361009fb5bdb05f2b0e
Git branch:      heads/refs/tags/v6.2.0
Build timestamp: 2022-08-22 01:40:02Z
Go version:      go version go1.18.5 linux/amd64

[2022/09/02 12:28:10.616 +08:00] [INFO] [versions.go:54] ["Welcome to dumpling"] ["Release Version"=v6.2.0] ["Git Commit Hash"=daf2b17cdfe30c02ce282361009fb5bdb05f2b0e] ["Git Branch"=heads/refs/tags/v6.2.0] ["Build timestamp"="2022-08-22 01:40:02"] ["Go Version"="go version go1.18.5 linux/amd64"]
[2022/09/02 12:28:10.618 +08:00] [WARN] [version.go:299] ["select tidb_version() failed, will fallback to 'select version();'"] [error="Error 1046: No database selected"]
[2022/09/02 12:28:10.618 +08:00] [INFO] [version.go:397] ["detect server version"] [type=MySQL] [version=5.7.39-log]
[2022/09/02 12:28:10.620 +08:00] [INFO] [dump.go:127] ["begin to run Dump"] [conf="{\"s3\":{\"endpoint\":\"\",\"region\":\"\",\"storage-class\":\"\",\"sse\":\"\",\"sse-kms-key-id\":\"\",\"acl\":\"\",\"access-key\":\"\",\"secret-access-key\":\"\",\"provider\":\"\",\"force-path-style\":true,\"use-accelerate-endpoint\":false},\"gcs\":{\"endpoint\":\"\",\"storage-class\":\"\",\"predefined-acl\":\"\",\"credentials-file\":\"\"},\"azblob\":{\"endpoint\":\"\",\"account-name\":\"\",\"account-key\":\"\",\"access-tier\":\"\"},\"AllowCleartextPasswords\":false,\"SortByPk\":true,\"NoViews\":true,\"NoSequences\":true,\"NoHeader\":false,\"NoSchemas\":false,\"NoData\":false,\"CompleteInsert\":false,\"TransactionalConsistency\":true,\"EscapeBackslash\":true,\"DumpEmptyDatabase\":true,\"PosAfterConnect\":false,\"CompressType\":0,\"Host\":\"192.168.99.24\",\"Port\":3306,\"Threads\":8,\"User\":\"root\",\"Security\":{\"CAPath\":\"\",\"CertPath\":\"\",\"KeyPath\":\"\"},\"LogLevel\":\"debug\",\"LogFile\":\"\",\"LogFormat\":\"text\",\"OutputDirPath\":\"/data/my_database/\",\"StatusAddr\":\":8281\",\"Snapshot\":\"\",\"Consistency\":\"flush\",\"CsvNullValue\":\"\\\\N\",\"SQL\":\"\",\"CsvSeparator\":\",\",\"CsvDelimiter\":\"\\\"\",\"Databases\":[],\"Where\":\"\",\"FileType\":\"sql\",\"ServerInfo\":{\"ServerType\":1,\"ServerVersion\":\"5.7.39-log\",\"HasTiKV\":false},\"Rows\":200000,\"ReadTimeout\":900000000000,\"TiDBMemQuotaQuery\":0,\"FileSize\":268435456,\"StatementSize\":1000000,\"SessionParams\":{},\"Tables\":{\"gdelt\":[{\"Name\":\"news_webpages\",\"AvgRowLength\":0,\"Type\":0}]},\"CollationCompatible\":\"loose\"}"]

你集群是什么版本的?
mysql是什么版本?

tidb集群版本是4.0.9 mysql版本是5.7.39

我看 日志里面有个[error="Error 1046: No database selected"]的错误

那个不关事的,因为 mysql 里头没有 tidb_version() 所以报这个错。

问题是 FTWRL 等锁超时了,卡住的时候进 db 里头 show processlist 看看,是不是有啥阻塞住了。

tidb集群版本是4.0.9还是建议使用dumpling版本4.0.9的再试试
不同版本工具容易出错