tikv / tikv/pd

Normalize the gRPC error handling

Open
#5,309 3 comments 0 reactions 0 assignees View on GitHub
type/development
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

As #5161 and tikv/tikv#12345 show, the gRPC error handling of PD is arbitrary. We mix using the gRPC error code and response header to return the error, which causes the TiKV may reconnect the PD incorrectly and unnecessarily. This is the tracking issue for normalizing the gRPC error handling of PD.

## TODOs

- [x] #5161
- [x] Normalize the definition of the two types of error on the PD side.
- gRPC Connection Error: an error that happens on the gRPC connection level, e.g, not the leader or unmatched cluster ID, which should cause the TiKV to re-establish the connection.
- gRPC Interface Error: an error that happens inside the gRPC interface logic, e.g, region/store not found or other PD internal errors, which should cause the TiKV to retry rather than reconnect.
- [ ] Redefine the error proto https://github.com/pingcap/kvproto/blob/08b02befd813c6f5e6629fc24ab249da98e87bb3/proto/pdpb.proto#L142
- [ ] Normalize the gRPC error handling on PD.
- [ ] Normalize the gRPC error handling on TiKV.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.