为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】
v5.0.1
【概述】 场景 + 问题概述
导出数据有近300g,将其导入数据库时使用了
nohup tiup br restore db
–pd “${PDIP}:2379”
–db “test”
–storage “local:///tidb/db_bak/test”
–ratelimit 2
–checksum-concurrency 2
–concurrency 2
–log-file /tidb/db_bak/testfull.log > br_bak.log &
导出出错:
Error: rpc error: code = Unknown desc = rpc error: code = Unavailable desc = not leader
Error: run /home/tidb/.tiup/components/br/v5.0.1/br
(wd:/home/tidb/.tiup/data/ShpsqtW) failed: exit status 1
使用:
RESTORE DATABASE test FROM ‘local:///data/tidb/db_bak/test’
RATE_LIMIT = 20 MB/SECOND
CONCURRENCY = 2
CHECKSUM = FALSE
SEND_CREDENTIALS_TO_TIKV = FALSE;
在tidb_error.log中报错:
[2021/09/03 16:21:18.301 +08:00] [ERROR] [split_client.go:284] [“fail to split region”] [region="{ID=485041,startKey=7480000000000024FFED00000000000000F8,endKey=7480000000000024FFFA00000000000000F8,epoch=“conf_ver:5 version:40700 “,peers=“id:485042 store_id:1 ,id:485043 store_id:4 ,id:485046 store_id:5 “}”] [regionErr=“message:“EpochNotMatch [region 485041] 485042 epoch changed conf_ver: 5 version: 40705 != conf_ver: 5 version: 40700, retry later” epoch_not_match:<current_regions:<id:485041 start_key:“t\200\000\000\000\000\000$\377\362\000\000\000\000\000\000\000\370” end_key:“t\200\000\000\000\000\000$\377\372\000\000\000\000\000\000\000\370” region_epoch:<conf_ver:5 version:40705 > peers:<id:485042 store_id:1 > peers:<id:485043 store_id:4 > peers:<id:485046 store_id:5 > > > “]
[2021/09/03 17:19:53.032 +08:00] [ERROR] [kv.go:159] [“fail to load safepoint from pd”] [error=“context deadline exceeded”]
[2021/09/03 17:20:22.816 +08:00] [ERROR] [import.go:333] [“ingest file failed”] [file=”{name=78439_3900092_4493_4ceb0178f56978a56590deab48cf91067d2f4a27dfca951c383f38e8078c1d58_1630174528733_write.sst,CF=write,sha256=4fdc18205680c4361172506d75c5dd99712ebba4565935a3a0f38d75dd735c60,startKey=7480000000000015685F698000000000000003013338396537303937FF3234366261656361FF3037316237623934FF6565333261626338FF0000000000000000F70380000000000F893F,endKey=7480000000000015685F698000000000000003013366636432393361FF3065333733366630FF6336316538633263FF3761646237313132FF0000000000000000F7038000000000DBAD47,startVersion=0,endVersion=427339404500795394,totalKvs=967144,totalBytes=72535800,CRC64Xor=12204858444521534217}”] [sstMeta=”{CF=write,endKeyExclusive=false,CRC32=0,length=41114208,regionID=493201,regionEpoch=“conf_ver:5 version:40950 “,startKey=7480000000000026FF3C5F698000000000FF0000030133383965FF37303937FF323436FF6261656361FF3037FF316237623934FF65FF65333261626338FFFF0000000000000000FFF70380000000000FFF893F000000000000F9,endKey=7480000000000026FF3C5F698000000000FF0000030133666364FF32386464FF383731FF3866656439FF6530FF653934333961FF33FF31313263363463FFFF0000000000000000FFF70380000000003BFF2421000000000000F9,UUID=54d60a21-a67e-4775-96b7-d6422289961a}”] [region=”{ID=493201,startKey=7480000000000026FF3C5F698000000000FF0000030133383965FF37303937FF323436FF6261656361FF3037FF316237623934FF65FF65333261626338FFFF0000000000000000FFF70380000000000FFF893F000000000000F9,endKey=7480000000000026FF3C5F698000000000FF0000030133666364FF32393361FF306533FF3733366630FF6336FF316538633263FF37FF61646237313132FFFF0000000000000000FFF7038000000000DBFFAD47000000000000F9,epoch=“conf_ver:5 version:40950 “,peers=“id:493202 store_id:1 ,id:493203 store_id:4 ,id:493204 store_id:5 “}”] [error=“ingest error message:“stale command” stale_command:<> : [BR:KV:ErrKVIngestFailed]ingest sst failed”]
[2021/09/03 17:21:16.349 +08:00] [ERROR] [import.go:333] [“ingest file failed”] [file=”{name=1_3886668_4493_9ec30876a7a93bf2f5033b2f96331a41fc5410e0bc28842a2ea092f87a968b98_1630174524971_write.sst,CF=write,sha256=b612c95f7cfdab8d23b6d0636365083da136e0c2a8b0d3b0880b84ff9ad6ada2,startKey=7480000000000015685F698000000000000003013366636432393361FF3065333733366630FF6336316538633263FF3761646237313132FF0000000000000000F7038000000000DBAD47,endKey=7480000000000015685F698000000000000003013433383230333936FF3961336465363332FF3936323765646363FF6563336566663666FF0000000000000000F7038000000000508B8D,startVersion=0,endVersion=427339404500795394,totalKvs=499544,totalBytes=37465800,CRC64Xor=11418854896832447389}”] [sstMeta=”{CF=write,endKeyExclusive=false,CRC32=0,length=21234802,regionID=493205,regionEpoch=“conf_ver:5 version:40950 “,startKey=7480000000000026FF3C5F698000000000FF0000030133666364FF32393361FF306533FF3733366630FF6336FF316538633263FF37FF61646237313132FFFF0000000000000000FFF7038000000000DBFFAD47000000000000F9,endKey=7480000000000026FF3C5F698000000000FF0000030134333832FF30323832FF633638FF3962356239FF6663FF616365386539FF31FF64396333666134FFFF0000000000000000FFF703800000000116FFF506000000000000F9,UUID=e81fa5b4-9278-410b-b780-0429c3c8825b}”] [region=”{ID=493205,startKey=7480000000000026FF3C5F698000000000FF0000030133666364FF32393361FF306533FF3733366630FF6336FF316538633263FF37FF61646237313132FFFF0000000000000000FFF7038000000000DBFFAD47000000000000F9,endKey=7480000000000026FF3C5F698000000000FF0000030134333832FF30333936FF396133FF6465363332FF3936FF323765646363FF65FF63336566663666FFFF0000000000000000FFF703800000000050FF8B8D000000000000F9,epoch=“conf_ver:5 version:40950 “,peers=“id:493206 store_id:1 ,id:493207 store_id:4 ,id:493208 store_id:5 “}”] [error=“ingest error message:“stale command” stale_command:<> : [BR:KV:ErrKVIngestFailed]ingest sst failed”]
[2021/09/03 17:24:07.837 +08:00] [ERROR] [client.go:599] [”[pd] getTS error”] [dc-location=global] [error=”[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster”]
[2021/09/03 17:24:11.750 +08:00] [ERROR] [client.go:599] [”[pd] getTS error"] [dc-location=global] [error="[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]
[2021/09/03 17:24:11.750 +08:00] [ERROR] [pd.go:215] [“updateTS error”] [txnScope=global] [error=“rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster”]
[2021/09/03 17:24:11.753 +08:00] [ERROR] [client.go:599] ["[pd] getTS error"] [dc-location=global] [error="[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]
[2021/09/03 17:24:11.753 +08:00] [ERROR] [pd.go:215] [“updateTS error”] [txnScope=global] [error=“rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster”]
[2021/09/03 17:24:20.273 +08:00] [ERROR] [pd.go:215] [“updateTS error”] [txnScope=global] [error=“rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster”]
[2021/09/03 17:24:20.665 +08:00] [ERROR] [client.go:599] ["[pd] getTS error"] [dc-location=global] [error="[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]
[2021/09/03 17:24:21.047 +08:00] [ERROR] [base_client.go:166] ["[pd] failed updateMember"] [error="[PD:client:ErrClientGetLeader]get leader from [http://10.1.40.21:2379 http://10.1.40.22:2379 http://10.1.40.23:2379] error"]
[2021/09/03 17:24:21.203 +08:00] [ERROR] [client.go:599] ["[pd] getTS error"] [dc-location=global] [error="[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]
[2021/09/03 17:24:21.206 +08:00] [ERROR] [base_client.go:166] ["[pd] failed updateMember"] [error="[PD:client:ErrClientGetLeader]get leader from [http://10.1.40.21:2379 http://10.1.40.22:2379 http://10.1.40.23:2379] error"]
【备份和数据迁移策略逻辑】
最终都是异常退出,请帮忙看一下了,困扰了好久。
【背景】 做过哪些操作
【现象】 业务和数据库现象
【问题】 当前遇到的问题
【业务影响】
【TiDB 版本】
【附件】
- 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
- TiUP Cluster Display 信息
- TiUP CLuster Edit config 信息
- TiDB-Overview 监控
- 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
- 对应模块日志(包含问题前后 1 小时日志)
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。