为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】
生产环境
【概述】 场景 + 问题概述
使用BR恢复单库时报错,备份时没有报错显示成功。
备份显示成功
br backup db --pd “10...:2379" --db wallet --storage “local:///nfs/backup/tidb-dumpbackup/wallet/${TODAY}” --ratelimit 120 --log-file backuptable-wallet_${TODAY}.log
恢复时报错。
br restore db --pd "10.110..**:2379” --db “wallet” --ratelimit 128 --storage “local:///nfs/backup/wallet/nfs/backup/tidb-dumpbackup/wallet/20220318” --log-file restorefull-wallet.logDetail BR log in restorefull-wallet.log
【备份和数据迁移策略逻辑】
【背景】 做过哪些操作
【现象】 业务和数据库现象
【问题】 当前遇到的问题
【业务影响】
【TiDB 版本】
Tidbv4.0.15
【附件】
- 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
- TiUP Cluster Display 信息
- TiUP CLuster Edit config 信息
- TiDB-Overview 监控
- 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
- 对应模块日志(包含问题前后 1 小时日志)
[2022/03/24 10:22:50.455 +08:00] [INFO] [client.go:559] [“import file done”] [file=“{name=1_1294966_7028_832249a2b2156435a0612a79e4acef7213260e98683dd96e99af59137ca29c20_1647554989832_write.sst,CF=write,sha256=4bd3cf1f8fa1d0b333de205899a16b07e0acba0deb9be5dfcf07773eb4a07311,startKey=7480000000000003B55F728000000039B1E8F2,endKey=7480000000000003B55F728000000039B45DA4,startVersion=0,endVersion=431896501412429852,totalKvs=0,totalBytes=0,CRC64Xor=0}”] [take=64.16µs][2022/03/24 10:22:50.455 +08:00] [WARN] [backoff.go:79] [“unexcepted error, stop to retry”] [error=“rpc error: code = Canceled desc = context canceled”] [errorVerbose=“rpc error: code = Canceled desc = context canceled
github.com/tikv/pd/client.(*client).ScanRegions
\tgithub.com/tikv/pd@v0.0.0-20210105112549-e5be7fd38659/client/client.go:598
github.com/pingcap/br/pkg/restore.(*pdClient).ScanRegions
\tgithub.com/pingcap/br@/pkg/restore/split_client.go:385
github.com/pingcap/br/pkg/restore.PaginateScanRegion.func1
\tgithub.com/pingcap/br@/pkg/restore/split.go:328
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.PaginateScanRegion
\tgithub.com/pingcap/br@/pkg/restore/split.go:324
github.com/pingcap/br/pkg/restore.(*FileImporter).Import.func1
\tgithub.com/pingcap/br@/pkg/restore/import.go:226
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.(*FileImporter).Import
\tgithub.com/pingcap/br@/pkg/restore/import.go:222
github.com/pingcap/br/pkg/restore.(*Client).RestoreFiles.func2
\tgithub.com/pingcap/br@/pkg/restore/client.go:563
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357”][2022/03/24 10:22:50.455 +08:00] [INFO] [client.go:559] [“import file done”] [file=“{name=1_2235117_7122_c43723965281a9f7e431b9a17ecf2ee253fb8340e76a272975d7aa7632043146_1647555024804_write.sst,CF=write,sha256=8baa8be36f947ba09532e05558df2a093bb9b1998e6fb668b5c1f3bc3aaab797,startKey=7480000000000003B55F728000000045D5C4A5,endKey=7480000000000003B55F728000000045D7C266,startVersion=0,endVersion=431896501412429852,totalKvs=0,totalBytes=0,CRC64Xor=0}”] [take=58.094µs][2022/03/24 10:22:50.455 +08:00] [WARN] [backoff.go:79] [“unexcepted error, stop to retry”] [error=“rpc error: code = Canceled desc = context canceled”] [errorVerbose=“rpc error: code = Canceled desc = context canceled
github.com/pingcap/errors.AddStack
\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/errors.go:174
github.com/pingcap/errors.Trace
\tgithub.com/pingcap/errors@v0.11.5-0.20201126102027-b0a155152ca3/juju_adaptor.go:15
github.com/pingcap/br/pkg/restore.(*FileImporter).ingestSST
\tgithub.com/pingcap/br@/pkg/restore/import.go:479
github.com/pingcap/br/pkg/restore.(*FileImporter).Import.func1
\tgithub.com/pingcap/br@/pkg/restore/import.go:278
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.(*FileImporter).Import
\tgithub.com/pingcap/br@/pkg/restore/import.go:222
github.com/pingcap/br/pkg/restore.(*Client).RestoreFiles.func2
\tgithub.com/pingcap/br@/pkg/restore/client.go:563
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357”][2022/03/24 10:22:50.455 +08:00] [INFO] [client.go:559] [“import file done”] [file=“{name=2_1915562_7462_47e0e8a985c5b79f0276749ece3da6835e92a6727e96692ab9022fa13e9c9425_1647555224214_write.sst,CF=write,sha256=be4cf6b04389329acc20365b6deb3695ea1d92d9ecfc50efad1759498b7666e1,startKey=7480000000000003B55F698000000000000009014E00000000000000F80419ABD400000000000380000000000F4240013130303030353532FF0000000000000000F7014555520000000000FA0610048000000000010510013131340000000000FA014E00000000000000F8014E00000000000000F803800000005031B125,endKey=7480000000000003B55F698000000000000009014E00000000000000F80419ABD600000000000380000000000F4240013333303030303030FF3233000000000000F9015553440000000000FA0610048000000000010000013131340000000000FA014E00000000000000F8014E00000000000000F8038000000050403D24,startVersion=0,endVersion=431896501412429852,totalKvs=612417,totalBytes=76778967,CRC64Xor=3650794703154434730}”] [take=210.44µs][2022/03/24 10:22:50.442 +08:00] [WARN] [backoff.go:79] [“unexcepted error, stop to retry”] [error=“rpc error: code = Canceled desc = context canceled”] [errorVerbose=“rpc error: code = Canceled desc = context canceled
github.com/tikv/pd/client.(*client).ScanRegions
\tgithub.com/tikv/pd@v0.0.0-20210105112549-e5be7fd38659/client/client.go:598
github.com/pingcap/br/pkg/restore.(*pdClient).ScanRegions
\tgithub.com/pingcap/br@/pkg/restore/split_client.go:385
github.com/pingcap/br/pkg/restore.PaginateScanRegion.func1
\tgithub.com/pingcap/br@/pkg/restore/split.go:328
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.PaginateScanRegion
\tgithub.com/pingcap/br@/pkg/restore/split.go:324
github.com/pingcap/br/pkg/restore.(*FileImporter).Import.func1
\tgithub.com/pingcap/br@/pkg/restore/import.go:226
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.(*FileImporter).Import
\tgithub.com/pingcap/br@/pkg/restore/import.go:222
github.com/pingcap/br/pkg/restore.(*Client).RestoreFiles.func2
\tgithub.com/pingcap/br@/pkg/restore/client.go:563
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357”][2022/03/24 10:22:50.442 +08:00] [ERROR] [main.go:58] [“br failed”] [error=“scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA: [BR:PD:ErrPDBatchScanRegion]batch scan region; scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA: [BR:PD:ErrPDBatchScanRegion]batch scan region; scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA: [BR:PD:ErrPDBatchScanRegion]batch scan region”] [errorVerbose="the following errors occurred:\
- [BR:PD:ErrPDBatchScanRegion]batch scan region
scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA
github.com/pingcap/br/pkg/restore.checkRegionConsistency
\tgithub.com/pingcap/br@/pkg/restore/split.go:288
github.com/pingcap/br/pkg/restore.PaginateScanRegion.func1
\tgithub.com/pingcap/br@/pkg/restore/split.go:344
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.PaginateScanRegion
\tgithub.com/pingcap/br@/pkg/restore/split.go:324
github.com/pingcap/br/pkg/restore.(*RegionSplitter).Split
\tgithub.com/pingcap/br@/pkg/restore/split.go:90
github.com/pingcap/br/pkg/restore.SplitRanges
\tgithub.com/pingcap/br@/pkg/restore/util.go:370
github.com/pingcap/br/pkg/restore.(*tikvSender).splitWorker.func2
\tgithub.com/pingcap/br@/pkg/restore/pipeline_items.go:283
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357\ - [BR:PD:ErrPDBatchScanRegion]batch scan region
scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA
github.com/pingcap/br/pkg/restore.checkRegionConsistency
\tgithub.com/pingcap/br@/pkg/restore/split.go:288
github.com/pingcap/br/pkg/restore.PaginateScanRegion.func1
\tgithub.com/pingcap/br@/pkg/restore/split.go:344
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.PaginateScanRegion
\tgithub.com/pingcap/br@/pkg/restore/split.go:324
github.com/pingcap/br/pkg/restore.(*RegionSplitter).Split
\tgithub.com/pingcap/br@/pkg/restore/split.go:90
github.com/pingcap/br/pkg/restore.SplitRanges
\tgithub.com/pingcap/br@/pkg/restore/util.go:370
github.com/pingcap/br/pkg/restore.(*tikvSender).splitWorker.func2
\tgithub.com/pingcap/br@/pkg/restore/pipeline_items.go:283
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357\ - [BR:PD:ErrPDBatchScanRegion]batch scan region
scan region return empty result, startKey: 7480000000000001FF6B5F728000000046FFEA41180000000000FA, endkey: 7480000000000001FF6B5F728000000047FFFE10C40000000000FA
github.com/pingcap/br/pkg/restore.checkRegionConsistency
\tgithub.com/pingcap/br@/pkg/restore/split.go:288
github.com/pingcap/br/pkg/restore.PaginateScanRegion.func1
\tgithub.com/pingcap/br@/pkg/restore/split.go:344
github.com/pingcap/br/pkg/utils.WithRetry
\tgithub.com/pingcap/br@/pkg/utils/retry.go:47
github.com/pingcap/br/pkg/restore.PaginateScanRegion
\tgithub.com/pingcap/br@/pkg/restore/split.go:324
github.com/pingcap/br/pkg/restore.(*RegionSplitter).Split
\tgithub.com/pingcap/br@/pkg/restore/split.go:90
github.com/pingcap/br/pkg/restore.SplitRanges
\tgithub.com/pingcap/br@/pkg/restore/util.go:370
github.com/pingcap/br/pkg/restore.(*tikvSender).splitWorker.func2
\tgithub.com/pingcap/br@/pkg/restore/pipeline_items.go:283
github.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1
\tgithub.com/pingcap/br@/pkg/utils/worker.go:73
golang.org/x/sync/errgroup.(*Group).Go.func1
\tgolang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57
runtime.goexit
\truntime/asm_amd64.s:1357"] [stack=“main.main
\tgithub.com/pingcap/br@/cmd/br/main.go:58
runtime.main
\truntime/proc.go:203”]
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。