release-23.1: rpc: use the loopback conn also for GRPCDialOptions #103775
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #103764 on behalf of @knz.
/cc @cockroachdb/release
Fixes #103762.
Fixes #99261.
Fixes #103692.
For context,
rpc.GRPCDialOptions
is used in two cases:--join
flag.The first one nearly always targets remotes nodes. The second one always targets the local node (it's a loopback connection).
Prior to this patch, the 2 callers to
rpc.GRPCDialOptions
would be served the regular "remote network conn" dial options unconditionally, including the backoff, only-once-dialer and other parameters suitable to connect to other nodes remotely.While this choice is suitable for the
--join
logic, it's not suitable for the grpc-gateway loopback conn. In that case, we want to avoid all the network intelligence and especially avoid the only-once-dialer and circuit breaker.This patch ensures that grpc-gateway receives the loopback parameters properly.
Release note (bug fix): A bug was fixed whereby under high CPU load,
HTTP requests to certain API endpoints (e.g. the health endpoint)
could start failing and then never succeed again until the node was
restarted. This bug had been introduced in v23.1.
Release justification: fixes major regression in 23.1