tikv / tikv/pd

Handle the EOF/Context canceled error caused by TSO Follower Proxy disabling

Open
#4,249 0 comments 0 reactions 0 assignees View on GitHub
component/client component/tso type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Feature Request

### Describe your feature request related problem

Now we can enable/disable TSO Follower Proxy online, however, when we change it from on to off, there are two corner cases that will occur.

#### EOF/Context canceled Error

`c.tryConnectWithProxy` will rebuild the `connectionCtxs` and cancel the old stream, if we have an ongoing TSO gRPC request, this will cause an `EOF/Context canceled` error.

#### Old closed stream chosen

Because we will randomly choose a stream and wait for the incoming TSO request from a channel, so if any `connectionCtxs` rebuilding happens after the stream choosing, it will make the TSO requests in the future fail due to the chosen stream being closed.

These two cases won't affect the TiDB now because it has the TSO backoff strategy. However, I think it's still worth being fixed.

### Describe the feature you'd like

Enabling/Disabling the TSO Follower Proxy online won't affect the TSO request at all. Everything will run smoothly with no error occurring.

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.