cockroachdb / cockroachdb/cockroach

kvserver/rangefeed: StreamManager.NewStream fatal message formats the wrong value

Open Beginner friendly
#172,422 0 comments 0 reactions 0 assignees View on GitHub
A-kv-rangefeed branch-master C-bug O-agent P-3 T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

The fatal in `StreamManager.NewStream` formats the `StreamManager` itself rather than the offending sender ([stream_manager.go#L110](https://github.com/cockroachdb/cockroach/blob/a7e117882b4356096b3a8ea26046baa7e5d53fce/pkg/kv/kvserver/rangefeed/stream_manager.go#L110)):

```go
log.KvExec.Fatalf(context.Background(), "unexpected sender type %T", sm)
```

Should be `sm.sender`. Unreachable with the two current sender implementations, but if a third sender is ever added, the crash message would report `*rangefeed.StreamManager` and mislead whoever debugs it.

**Additional context**

Found during an agent-assisted correctness audit of the rangefeed subsystem. Code link is pinned to master @ a7e1178.

Jira issue: CRDB-65658

Contributor guide

Open the contributing guide

Research direction

Start in pkg/kv/kvserver/rangefeed/stream_manager.go at StreamManager.NewStream, specifically the fatal call around line 110. Verify which value the message formats and update the behavior so the reported type is the offending sender; done when the fatal message identifies that sender rather than the StreamManager.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.