Handle the EOF/Context canceled error caused by TSO Follower Proxy disabling #4249
Labels
component/client
Client logic.
component/tso
Timestamp Oracle.
type/enhancement
The issue or PR belongs to an enhancement.
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 theconnectionCtxs
and cancel the old stream, if we have an ongoing TSO gRPC request, this will cause anEOF/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.
The text was updated successfully, but these errors were encountered: