-
Notifications
You must be signed in to change notification settings - Fork 100
br restore statistics not correct if restore with -f parameters #1270
Description
Please answer these questions before submitting your issue. Thanks!
-
What did you do?
If possible, provide a recipe for reproducing the error. -
Import some data (5GB) to table test.oomtest, and there is no user created tables in mysql schema
-
Do full backup
-
Do br restore, and specify -f "mysql.*" parameter to restore system tables only
-
What did you expect to see?
- no tables should be restored, as there is no user created tables in mysql schema, and restore statistics should be accurate.
- What did you see instead?
- Restore statistics not accurate, 7.426GB seems the backup size, not the restored data size.
- Also, it seems that restore statistics is not correctly when restore part of the backup. (for example, there are 2 tables in backup, and restore only one tables.)
[2021/06/23 01:56:29.793 -04:00] [INFO] [collector.go:66] ["Full restore success summary"] [total-ranges=44] [ranges-succeed=44] [ranges-failed=0] [split-region=601.358689ms] [restore-checksum=43.793886ms] [restore-ranges=19] [total-take=6.156156669s] ["restore data size(after decompressed)"=7.426GB] [total-kv=3345] [total-kv-size=287kB] [average-speed=584.5kB/s]
[root@localhost v5.1.0]# ./br restore full --pd "172.16.6.226:2379" --storage "s3://nfs/fubin/br0623?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true" --send-credentials-to-tikv=true -f "mysql*.*" --log-file restore.system.2.log
Detail BR log in restore.system.2.log
Full restore <---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|> 100.00%[2021/06/23 01:56:29.111 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_meta]
[2021/06/23 01:56:29.111 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_buckets]
[2021/06/23 01:56:29.115 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=gc_delete_range_done]
[2021/06/23 01:56:29.117 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_feedback]
[2021/06/23 01:56:29.117 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=schema_index_usage]
[2021/06/23 01:56:29.117 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=gc_delete_range]
[2021/06/23 01:56:29.117 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=default_roles]
[2021/06/23 01:56:29.133 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=columns_priv]
[2021/06/23 01:56:29.134 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=GLOBAL_VARIABLES]
[2021/06/23 01:56:29.134 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=db]
[2021/06/23 01:56:29.134 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_extended]
[2021/06/23 01:56:29.134 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=tables_priv]
[2021/06/23 01:56:29.134 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=tidb]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=role_edges]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_histograms]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=global_priv]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_fm_sketch]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=user]
[2021/06/23 01:56:29.149 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring unsupported mysql schema table"] [table=global_grants]
[2021/06/23 01:56:29.150 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via mysql schema isn't support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_top_n]
[2021/06/23 01:56:29.150 -04:00] [WARN] [systable_restore.go:104] ["error during reconfigurating the system tables"] [database=mysql] [error="restored user info may not take effect, until you should execute FLUSH PRIVILEGES manually: [BR:Restore:ErrUnsupportedSysTable]the system table isn't supported for restoring yet"]
Full restore <----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/06/23 01:56:29.793 -04:00] [INFO] [collector.go:66] ["Full restore success summary"] [total-ranges=44] [ranges-succeed=44] [ranges-failed=0] [split-region=601.358689ms] [restore-checksum=43.793886ms] [restore-ranges=19] [total-take=6.156156669s] ["restore data size(after decompressed)"=7.426GB] [total-kv=3345] [total-kv-size=287kB] [average-speed=584.5kB/s]
- What version of BR and TiDB/TiKV/PD are you using?
-
Operation logs
- Please upload
br.logfor BR if possible - Please upload
tidb-lightning.logfor TiDB-Lightning if possible - Please upload
tikv-importer.logfrom TiKV-Importer if possible - Other interesting logs
restore.system.2.log
- Please upload
-
Configuration of the cluster and the task
tidb-lightning.tomlfor TiDB-Lightning if possibletikv-importer.tomlfor TiKV-Importer if possibletopology.ymlif deployed by TiUP
-
Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus if possible