Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: Region is unavailable
[TiDB Usage Environment] Production Environment / Testing / PoC
Production Environment
[TiDB Version] v5.4.2
[Encountered Problem]
Using DM to synchronize from upstream MySQL to TiDB, suddenly the synchronization delay increased yesterday.
Looking at the tidb cluster_processlist process, a bunch of write operations are piling up
REPLACE INTO
weplayzy.
dd_recommend_new (
Looking at the TiDB logs, it indicates Region is unavailable
[2022/11/02 15:29:58.257 +08:00] [WARN] [backoff.go:152] ["regionMiss backoffer.maxSleep 40000ms is exceeded, errors:\nepoch_not_match:<> at 2022-11-02T15:29:56.63521457+08:00\nepoch_not_match:<> at 2022-11-02T15:29:57.528003335+08:00\nepoch_not_match:<> at 2022-11-02T15:29:58.257138997+08:00"]
[2022/11/02 15:29:58.257 +08:00] [WARN] [session.go:1719] ["run statement failed"] [conn=5429] [schemaVersion=423853] [error="[tikv:9005]Region is unavailable"] [session="{\n \"currDBName\": \"\",\n \"id\": 5429,\n \"status\": 3,\n \"strictMode\": false,\n \"txn\": \"437092125073735682\",\n \"user\": {\n \"Username\": \"tidb_user\",\n \"Hostname\": \"10.0.8.183\",\n \"CurrentUser\": false,\n \"AuthUsername\": \"tidb_user\",\n \"AuthHostname\": \"%\"\n }\n}"]
[2022/11/02 15:29:58.257 +08:00] [INFO] [conn.go:1117] ["command dispatched failed"] [conn=5429] [connInfo="id:5429, addr:10.0.8.183:30432 status:11, collation:utf8mb4_general_ci, user:tidb_user"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="REPLACE INTO `weplayzy`.`dd_recommend_new` (`id`,`god_uid`,`category_id`,`online_score`,`order_score`,`time_score`,`pay_score`,`gift_score`,`price_score`,`game_price_score`,`fun_price_score`,`single_score`,`expired_score`,`speech_score`,`createtime_score`,`star_score`,`god_click_score`,`chat_num_score`,`chat_rate_score`,`room_click_score`,`room_enter_pay_score`,`order_all_score`,`score`,`score_rank`,`final_rank`,`nickname`,`update_time`) VALUES (12714,15082961,56,0,0,0,0,0,0.5599651414767486,0.5599651414767486,0,0,0,0,0.7223192902226421,0,0,0,0,0,0,0,0,3144,3144,_binary'兔啊兔',_binary'2022-11-01 14:00:48')"] [txn_mode=OPTIMISTIC] [err="[tikv:9005]Region is unavailable"]
At this time, querying weplayzy
.dd_recommend_new
is stuck
select * from weplayzy
.dd_recommend_new
limit 10;
Is the data of weplayzy
.dd_recommend_new
located in an unavailable Region? How to handle this situation?