cockroachdb / cockroachdb/cockroach
kvserver/rangefeed: catch up scan doesn't watch for context cancellation
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
https://github.com/cockroachdb/cockroach/blob/8a43fac15a431b6a85a33da292cbd3ecb662f169/pkg/kv/kvserver/rangefeed/catchup_scan.go#L143 doesn't watch for context cancellation properly. This means that - when registration disconnects and server sends an error back to client notifying rangefeed completion, catch up scans for this registration may still be running. Once catch up scan is done, registration eventually shut down here https://github.com/cockroachdb/cockroach/blob/8a43fac15a431b6a85a33da292cbd3ecb662f169/pkg/kv/kvserver/rangefeed/registry.go#L354. But this may cause problems when catch up scans are taking long.
Jira issue: CRDB-39683
Contributor guide
Assessment
This issue has not been assessed yet.