How to Handle Missing Leader

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

Original topic: missing leader如何处理

| username: h5n1

[Version] 5.2.3 arm
[Issue]
TiKV log reports:

[2022/09/10 22:03:53.051 +08:00] [WARN] [peer.rs:4082] ["leader missing longer than max_leader_missing_duration. To check with pd and other peers whether it's still valid"] [expect=2h] [**peer_id=1672003177] [region_id=1659059842] 

How should these missing leaders be handled?

$ pd-ctl region 1659059842
{
“id”: 1659059842,
“start_key”: “748000000000007EFFB95F728000000026FF07F87D0000000000FA”,
“end_key”: “748000000000007EFFB95F728000000026FF093D7B0000000000FA”,
“epoch”: {
“conf_ver”: 72629,
“version”: 127640
},
“peers”: [
{
“id”: 1659059843,
“store_id”: 2,
“role_name”: “Voter”
},
{
“id”: 1659059844,
“store_id”: 1561469454,
“role_name”: “Voter”
},
{
“id”: 1659059845,
“store_id”: 11107291,
“role_name”: “Voter”
}
],
“leader”: {
“id”: 1659059844,
“store_id”: 1561469454,
“role_name”: “Voter”
},
“written_bytes”: 1523,
“read_bytes”: 0,
“written_keys”: 2,
“read_keys”: 0,
“approximate_size”: 3,
“approximate_keys”: 81920
}

image

The region shows no table, does the table really not exist?
image

| username: xfworld | Original post link

Did the region lose the leader, or did all the replicas get lost, leaving only the metadata?

If all the replicas are lost, you can directly remove the metadata…

| username: h5n1 | Original post link

A certain peer was ruthlessly abandoned by the raft group, left without organization or leadership.

| username: xfworld | Original post link

You can clean it up… It’s standard junk data :custard:

How was this data generated?

| username: alfred | Original post link

WARN level logs don’t have an impact, right? What operation caused them?