-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
70017: rpc: avoid network IO in `Dialer.ConnHealth` r=knz,tbg a=erikgrinaker `Dialer.ConnHealth` is used to check whether a healthy RPC connection exists to a given node, in order to avoid interacting with unavailable nodes. However, this actually attempted to dial the node if no connection was found, which can block for tens of seconds in the case of an unresponsive node. This is problematic since it is used in performance-critical code paths, including Raft command application. This patch changes `Dialer.ConnHealth` to avoid dialing the node, and adds a `Context.ConnHealth` helper with access to the RPC connection registry. Because `DistSQLPlanner` relied on `ConnHealth` to dial the remote node, it also adds `Dialer.ConnHealthTryDial` which retains the old behavior for use in DistSQL until a better solution can be implemented. Resolves #69888. Release note (bug fix): Avoid dialing nodes in performance-critical code paths, which could cause substantial latency when encountering unresponsive nodes (e.g. when a VM or server is shut down). Co-authored-by: Erik Grinaker <[email protected]>
- Loading branch information
Showing
4 changed files
with
258 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters