Full Backup and Restore in BR: System Database Cannot Be Restored

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: BR 全备份和恢复,系统库无法恢复

| username: 快乐的非鱼

[TiDB Usage Environment] Test
[TiDB Version] 6.5.1
[Reproduction Path] Using BR for full backup, achieved cluster effect in a single-machine environment
[Encountered Problem: Problem Phenomenon and Impact]
Both backup and restore prompts were successful, but a single table in the mysql database, such as analyze_options, was manually deleted after the backup and could not be restored. Except for system tables, the user’s database is okay.
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]
[2023/03/20 11:51:32.811 +08:00] [INFO] [info.go:49] [“Welcome to Backup & Restore (BR)”] [release-version=v6.5.1] [git-hash=4084b077d615f9dc0a41cf2e30bc6e1a02332df2] [git-branch=heads/refs/tags/v6.5.1] [go-version=go1.19.5] [utc-build-time=“2023-03-07 16:04:15”] [race-enabled=false]
[2023/03/20 11:51:32.811 +08:00] [INFO] [common.go:718] [arguments] [__command=“br restore table”] [db=mysql] [log-file=backup.log] [pd=“[:2379]”] [ratelimit=128] [storage=local:///data/tidb/backup/br] [table=analyze_options]
[2023/03/20 11:51:32.811 +08:00] [INFO] [common.go:159] [“trying to connect to etcd”] [addr=“[:2379]”]
[2023/03/20 11:51:32.812 +08:00] [INFO] [conn.go:147] [“new mgr”] [pdAddrs=:2379]
[2023/03/20 11:51:32.812 +08:00] [INFO] [client.go:405] [“[pd] create pd client with endpoints”] [pd-address=“[:2379]”]
[2023/03/20 11:51:32.814 +08:00] [INFO] [base_client.go:360] [“[pd] update member urls”] [old-urls=“[http://:2379]”] [new-urls=“[http://192.168.68.10:2379,http://192.168.68.10:2381]”]
[2023/03/20 11:51:32.814 +08:00] [INFO] [base_client.go:378] [“[pd] switch leader”] [new-leader=http://192.168.68.10:2379] [old-leader=]
[2023/03/20 11:51:32.814 +08:00] [INFO] [base_client.go:105] [“[pd] init cluster id”] [cluster-id=7212221220004930598]
[2023/03/20 11:51:32.814 +08:00] [INFO] [client.go:698] [“[pd] tso dispatcher created”] [dc-location=global]
[2023/03/20 11:51:32.814 +08:00] [INFO] [conn.go:121] [“checked alive KV stores”] [aliveStores=2] [totalStores=2]
[2023/03/20 11:51:32.814 +08:00] [INFO] [client.go:405] [“[pd] create pd client with endpoints”] [pd-address=“[:2379]”]
[2023/03/20 11:51:32.815 +08:00] [INFO] [base_client.go:360] [“[pd] update member urls”] [old-urls=“[http://:2379]”] [new-urls=“[http://192.168.68.10:2379,http://192.168.68.10:2381]”]
[2023/03/20 11:51:32.815 +08:00] [INFO] [base_client.go:378] [“[pd] switch leader”] [new-leader=http://192.168.68.10:2379] [old-leader=]
[2023/03/20 11:51:32.815 +08:00] [INFO] [base_client.go:105] [“[pd] init cluster id”] [cluster-id=7212221220004930598]
[2023/03/20 11:51:32.815 +08:00] [INFO] [client.go:698] [“[pd] tso dispatcher created”] [dc-location=global]
[2023/03/20 11:51:32.816 +08:00] [INFO] [tidb.go:77] [“new domain”] [store=tikv-7212221220004930598] [“ddl lease”=1s] [“stats lease”=-1ns] [“index usage sync lease”=0s]
[2023/03/20 11:51:32.947 +08:00] [INFO] [domain.go:2286] [acquireServerID] [serverID=2166121] [“lease id”=38d386f9acefc7a2]
[2023/03/20 11:51:33.053 +08:00] [WARN] [info.go:245] [“init TiFlashReplicaManager”] [“pd addrs”=“[192.168.68.10:2381,192.168.68.10:2379]”]
[2023/03/20 11:51:33.454 +08:00] [INFO] [domain.go:220] [“full load InfoSchema success”] [currentSchemaVersion=0] [neededSchemaVersion=121] [“start time”=5.758189ms]
[2023/03/20 11:51:33.529 +08:00] [INFO] [domain.go:487] [“full load and reset schema validator”]
[2023/03/20 11:51:33.529 +08:00] [INFO] [ddl.go:701] [“[ddl] start DDL”] [ID=56ce697b-0584-40f1-a761-9e0a4862ea9b] [runWorker=true]
[2023/03/20 11:51:33.529 +08:00] [INFO] [ddl.go:647] [“[ddl] start delRangeManager OK”] [“is a emulator”=false]
[2023/03/20 11:51:33.529 +08:00] [INFO] [manager.go:151] [“start campaign owner”] [ownerInfo=“[ddl] /tidb/ddl/fg/owner”]
[2023/03/20 11:51:33.529 +08:00] [INFO] [ddl_worker.go:171] [“[ddl] start DDL worker”] [worker=“worker 1, tp general”]
[2023/03/20 11:51:33.529 +08:00] [INFO] [ddl_worker.go:171] [“[ddl] start DDL worker”] [worker=“worker 2, tp add index”]
[2023/03/20 11:51:33.595 +08:00] [WARN] [env.go:52] [“[ddl-ingest] initialize environment failed”] [“storage limitation”=“only support TiKV storage”] [“current storage”=unistore] [“lightning is initialized”=false]
[2023/03/20 11:51:33.595 +08:00] [INFO] [env.go:108] [“[ddl-ingest] the lightning sorted dir”] [“data path:”=/tmp/tidb/tmp_ddl-4000]
[2023/03/20 11:51:33.595 +08:00] [INFO] [env.go:75] [“[ddl-ingest] init global lightning backend environment finished”] [“memory limitation”=2147483648] [“sort path disk quota”=48294789120] [“max open file number”=4096] [“lightning is initialized”=true]
[2023/03/20 11:51:33.595 +08:00] [INFO] [owner_daemon.go:70] [“begin advancer daemon”] [daemon-id=LogBackup::Advancer]
[2023/03/20 11:51:33.595 +08:00] [INFO] [manager.go:151] [“start campaign owner”] [ownerInfo=“[log-backup] /tidb/br-stream/owner”]
[2023/03/20 11:51:33.795 +08:00] [INFO] [owner_daemon.go:81] [“begin running daemon”] [id=6ced7bb9-f459-4115-b926-67f378be3b86] [daemon-id=LogBackup::Advancer]
[2023/03/20 11:51:33.795 +08:00] [WARN] [sysvar_cache.go:50] [“sysvar cache is empty, triggering rebuild”]
[2023/03/20 11:51:33.799 +08:00] [INFO] [ddl.go:1287] [“[ddl] switch metadata lock feature”] [enable=true]
[2023/03/20 11:51:33.799 +08:00] [INFO] [manager.go:151] [“start campaign owner”] [ownerInfo=“[stats] /tidb/stats/owner”]
[2023/03/20 11:51:33.847 +08:00] [INFO] [client.go:451] [“new worker pool”] [currency-count=128]
[2023/03/20 11:51:33.847 +08:00] [INFO] [client.go:264] [“set placement policy mode”] [mode=STRICT]
[2023/03/20 11:51:33.847 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.847 +08:00] [INFO] [manager.go:151] [“start campaign owner”] [ownerInfo=“[stats] /tidb/stats/owner”]
[2023/03/20 11:51:33.954 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.954 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.954 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.954 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.954 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.955 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.956 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.956 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.956 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.956 +08:00] [INFO] [db.go:75] [“set tidb_placement_mode success”] [mode=STRICT]
[2023/03/20 11:51:33.958 +08:00] [INFO] [client.go:2792] [“set new_collation_enabled”] [new_collation_enabled=true]
[2023/03/20 11:51:33.961 +08:00] [INFO] [client.go:384] [“load backupmeta”] [databases=2] [jobs=0]
[2023/03/20 11:51:33.962 +08:00] [INFO] [import.go:291] [“multi ingest support”] [support=true]
[2023/03/20 11:51:34.004 +08:00] [WARN] [restore.go:880] [“set max-index-length to max(30724) to skip check index length in DDL"]
[2023/03/20 11:51:34.004 +08:00] [INFO] [client.go:609] [“create database”] [name=__TiDB_BR_Temporary_mysql]
[2023/03/20 11:51:34.287 +08:00] [INFO] [ddl_worker.go:314] [“[ddl] add DDL jobs”] [“batch count”=1] [jobs=“ID:307, Type:create schema, State:queueing, SchemaState:none, SchemaID:306, TableID:0, RowCount:0, ArgLen:1, start time: 2023-03-20 11:51:34.056 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0; “] [table=true]
[2023/03/20 11:51:34.320 +08:00] [INFO] [ddl.go:1011] [”[ddl] start DDL job”] [job=“ID:307, Type:create schema, State:queueing, SchemaState:none, SchemaID:306, TableID:0, RowCount:0, ArgLen:1, start time: 2023-03-20 11:51:34.056 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0”] [query="/from(br)/CREATE DATABASE IF NOT EXISTS __TiDB_BR_Temporary_mysql /
!40100 DEFAULT CHARACTER SET utf8mb4 */”]
[2023/03/20 11:51:34.922 +08:00] [INFO] [domain.go:194] [“diff load InfoSchema success”] [currentSchemaVersion=121] [neededSchemaVersion=122] [“start time”=590.788µs] [phyTblIDs=“”] [actionTypes=“”]
[2023/03/20 11:51:35.146 +08:00] [INFO] [domain.go:707] [“session manager is nil”]
[2023/03/20 11:51:35.146 +08:00] [INFO] [domain.go:726] [“mdl gets lock, update to owner”] [jobID=307] [version=122]
[2023/03/20 11:51:35.596 +08:00] [INFO] [info.go:1068] [SetTiFlashGroupConfig]
[2023/03/20 11:51:35.822 +08:00] [INFO] [ddl.go:1109] [“[ddl] DDL job is finished”] [jobID=307]
[2023/03/20 11:51:35.822 +08:00] [INFO] [callback.go:121] [“performing DDL change, must reload”]
[2023/03/20 11:51:35.823 +08:00] [INFO] [client.go:748] [“start create tables”]
[2023/03/20 11:51:35.823 +08:00] [INFO] [client.go:244] [“registering the table IDs”] [ids=“ID:empty(end=61)”]
[2023/03/20 11:51:35.823 +08:00] [INFO] [client.go:859] [“create tables”] [“table start”=0] [“table end”=1]
[2023/03/20 11:51:35.823 +08:00] [INFO] [client.go:668] [“client to create tables”]
[2023/03/20 11:51:36.212 +08:00] [INFO] [ddl_worker.go:314] [“[ddl] add DDL jobs”] [“batch count”=1] [jobs=“ID:309, Type:create tables, State:queueing, SchemaState:none, SchemaID:306, TableID:0, RowCount:0, ArgLen:2, start time: 2023-03-20 11:51:36.006 +0800 CST, Err:, ErrCount:0, SnapshotVersion:0; “] [table=true]
[2023/03/20 11:51:36.253 +08:00] [INFO] [ddl.go:1011] [”[ddl] start DDL job”] [job="ID:309, Type:create tables, State:queueing, SchemaState:none, SchemaID:306, TableID:0, RowCount:0, Arg

| username: h5n1 | Original post link

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.