使用dumpling逻辑备份数据报placement_policies表不存在错误

【 TiDB 使用环境】测试
【 TiDB 版本】v5.4.2
【复现路径】集群从最初的v4.x一路升到目前的v5.4.2并且已经正常使用一段时间。
在执行dumpling备份数据的时候,出现报错:
Error 1146 (42S02): Table ‘information_schema.placement_policies’ doesn’t exist"] [errorVerbose="Error 1146 (42S02): Table ‘information_schema.placement_policies’ doesn’t exist\nsql: select distinct policy_name from information_schema.placement_policies where policy_name is not null;, args
具体错误信息如下:

[2023/03/16 11:45:24.158 +08:00] [INFO] [versions.go:54] ["Welcome to dumpling"] ["Release Version"=v6.6.0] ["Git Commit Hash"=f4ca0111fb96a2bdd37d2fb97eb26c07fc58d4e4] ["Git Branch"=heads/refs/tags/v6.6.0] ["Build timestamp"="2023-02-17 02:41:44"] ["Go Version"="go version go1.19.5 linux/amd64"]
[2023/03/16 11:45:24.161 +08:00] [INFO] [version.go:429] ["detect server version"] [type=TiDB] [version=5.4.2]
[2023/03/16 11:45:24.167 +08:00] [INFO] [client.go:408] ["[pd] create pd client with endpoints"] [pd-address="[10.0.0.10:2379,10.0.0.11:2379,10.0.0.81:2379]"]
[2023/03/16 11:45:24.170 +08:00] [INFO] [base_client.go:369] ["[pd] update member urls"] [old-urls="[http://10.0.0.10:2379,http://10.0.0.11:2379,http://10.0.0.81:2379]"] [new-urls="[http://10.0.0.10:2379,http://10.0.0.81:2379,http://10.0.0.11:2379]"]
[2023/03/16 11:45:24.170 +08:00] [INFO] [base_client.go:388] ["[pd] switch leader"] [new-leader=http://10.0.0.11:2379] [old-leader=]
[2023/03/16 11:45:24.170 +08:00] [INFO] [base_client.go:107] ["[pd] init cluster id"] [cluster-id=6893470701601176717]
[2023/03/16 11:45:24.170 +08:00] [INFO] [client.go:702] ["[pd] tso dispatcher created"] [dc-location=global]
[2023/03/16 11:45:24.171 +08:00] [INFO] [dump.go:1519] ["generate dumpling gc safePoint id"] [id=dumpling_1678938324171211009]
[2023/03/16 11:45:24.176 +08:00] [INFO] [dump.go:151] ["begin to run Dump"] [conf="{\"s3\":{\"endpoint\":\"\",\"region\":\"\",\"storage-class\":\"\",\"sse\":\"\",\"sse-kms-key-id\":\"\",\"acl\":\"\",\"access-key\":\"\",\"secret-access-key\":\"\",\"session-token\":\"\",\"provider\":\"\",\"force-path-style\":true,\"use-accelerate-endpoint\":false,\"role-arn\":\"\",\"external-id\":\"\",\"object-lock-enabled\":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\":true,\"CompleteInsert\":false,\"TransactionalConsistency\":true,\"EscapeBackslash\":true,\"DumpEmptyDatabase\":true,\"PosAfterConnect\":false,\"CompressType\":0,\"Host\":\"10.0.0.10\",\"Port\":4000,\"Threads\":4,\"User\":\"root\",\"Security\":{\"CAPath\":\"\",\"CertPath\":\"\",\"KeyPath\":\"\"},\"LogLevel\":\"info\",\"LogFile\":\"\",\"LogFormat\":\"text\",\"OutputDirPath\":\"/mnt/data/backup/mmd-cluster/mmd/schema/ddl\",\"StatusAddr\":\":1181\",\"Snapshot\":\"440123601042307590\",\"Consistency\":\"snapshot\",\"CsvNullValue\":\"\\\\N\",\"SQL\":\"\",\"CsvSeparator\":\",\",\"CsvDelimiter\":\"\\\"\",\"Databases\":[\"mmd_dev\"],\"Where\":\"\",\"FileType\":\"sql\",\"ServerInfo\":{\"ServerType\":3,\"ServerVersion\":\"5.4.2\",\"HasTiKV\":true},\"Rows\":0,\"ReadTimeout\":900000000000,\"TiDBMemQuotaQuery\":0,\"FileSize\":268435456,\"StatementSize\":1000000,\"SessionParams\":{\"tidb_snapshot\":\"440123601042307590\"},\"Tables\":{\"mmd_dev\":[{\"Name\":\"mmd_daily_statistics_log\",\"AvgRowLength\":0,\"Type\":0}]},\"CollationCompatible\":\"loose\",\"IOTotalBytes\":null,\"Net\":\"\"}"]
[2023/03/16 11:45:24.184 +08:00] [INFO] [conn.go:44] ["cannot execute query"] [retryTime=1] [sql="select distinct policy_name from information_schema.placement_policies where policy_name is not null;"] [args=null] [error="sql: select distinct policy_name from information_schema.placement_policies where policy_name is not null;, args: []: Error 1146 (42S02): Table 'information_schema.placement_policies' doesn't exist"] [errorVerbose="Error 1146 (42S02): Table 'information_schema.placement_policies' doesn't exist\nsql: select distinct policy_name from information_schema.placement_policies where policy_name is not null;, args: []\ngithub.com/pingcap/tidb/dumpling/export.simpleQueryWithArgs\n\tgithub.com/pingcap/tidb/dumpling/export/sql.go:1147\ngithub.com/pingcap/tidb/dumpling/export.(*BaseConn).QuerySQL.func1\n\tgithub.com/pingcap/tidb/dumpling/export/conn.go:42\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.(*BaseConn).QuerySQL\n\tgithub.com/pingcap/tidb/dumpling/export/conn.go:34\ngithub.com/pingcap/tidb/dumpling/export.ListAllPlacementPolicyNames\n\tgithub.com/pingcap/tidb/dumpling/export/sql.go:368\ngithub.com/pingcap/tidb/dumpling/export.(*Dumper).dumpDatabases\n\tgithub.com/pingcap/tidb/dumpling/export/dump.go:395\ngithub.com/pingcap/tidb/dumpling/export.(*Dumper).Dump\n\tgithub.com/pingcap/tidb/dumpling/export/dump.go:315\nmain.main\n\t./main.go:74\nruntime.main\n\truntime/proc.go:250\nruntime.goexit\n\truntime/asm_amd64.s:1594"]
[2023/03/16 11:45:24.187 +08:00] [INFO] [collector.go:255] ["backup success summary"] [total-ranges=2] [ranges-succeed=2] [ranges-failed=0] [total-take=3.708664ms]
[2023/03/16 11:45:24.187 +08:00] [INFO] [client.go:783] ["[pd] stop fetching the pending tso requests due to context canceled"] [dc-location=global]
[2023/03/16 11:45:24.187 +08:00] [INFO] [client.go:720] ["[pd] exit tso dispatcher"] [dc-location=global]
[2023/03/16 11:45:24.187 +08:00] [INFO] [main.go:81] ["dump data successfully, dumpling will exit now"]

【资源配置】
【附件:截图/日志/监控】

请问是什么原因导致的?

这个表真的存在不 ? 您 检查了没 ??

您的 dumpling工具是那个版本的 ? 都检查下 是否一致

dumpling版本是什么

我找到您上次 解决了这个问题了吧。

是的,我怀疑是dumpling版本过高导致的, placement_policies是6版本才有的系统表

那估计就是吧。 确定下是否真的存在, 不存在表的话,就是dumpling版本过高导致的

上一次是因为什么原因呢 ??

检查过没有placement_policies这个表

需要跟集群版本一致?

Version"=v6.6.0

已解决,把dumpling降回跟cluster一样的V5.4.2就可以了。

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