cockroachdb / cockroachdb/cockroach

Issue in nodedialer.ConnHealthTryDial causes distsql to attempt using unreachable nodes

Open
#145,441 1 comment 0 reactions 0 assignees View on GitHub
branch-master C-bug O-postmortem P-3 T-db-server
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

`GetAllInstancesByLocality` returns a list of healthy instances that distsql can use. It is expected to filters unhealthy nodes using the most recent heartbeats.
https://github.com/cockroachdb/cockroach/blob/c6ba5e4a2444e4629742229a62bc67877e8a47da/pkg/sql/distsql_physical_planner.go#L227-L250

`ConnHealthTryDial` is used by distsql to check if a node is healthy or not based on the most recent heartbeat. `ConnHealthTryDial` doesn't appear to identify the dead nodes as expected. This can result in distsql using unreachable nodes.
https://github.com/cockroachdb/cockroach/blob/b588b5941abd0fc778e785741493beebdd4b46b9/pkg/rpc/nodedialer/nodedialer.go#L247-L259

Jira issue: CRDB-49903

Contributor guide

Open the contributing guide

Research direction

Start by reading GetAllInstancesByLocality in pkg/sql/distsql_physical_planner.go and ConnHealthTryDial in pkg/rpc/nodedialer/nodedialer.go, focusing on how recent heartbeats identify unreachable nodes. Trace the distsql health check and run the relevant existing tests or reproduction if available. Done means distsql no longer selects nodes that the health check has identified as unreachable.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.