subscription_client.go currently owns too many responsibilities: event delivery to dynstream, region failure recovery, subscribed-span lifecycle, resolve-lock checking, and slow-region monitoring.
This makes the log puller runtime hard to read, hard to test, and harder to split follow-up changes safely.
We should extract these responsibilities into dedicated components:
regionEventSink for dynstream push/wake/feedback handling
regionFailureHandler for region error buffering and retry/reschedule logic
spanRegistry for subscribed span state, resolve-lock checking, slow-region logging, and related metrics
The goal of this change is structural only:
- keep existing behavior unchanged
- reduce the size and responsibility of
subscription_client.go
- make later scheduler/defer refactoring easier and safer
subscription_client.gocurrently owns too many responsibilities: event delivery to dynstream, region failure recovery, subscribed-span lifecycle, resolve-lock checking, and slow-region monitoring.This makes the log puller runtime hard to read, hard to test, and harder to split follow-up changes safely.
We should extract these responsibilities into dedicated components:
regionEventSinkfor dynstream push/wake/feedback handlingregionFailureHandlerfor region error buffering and retry/reschedule logicspanRegistryfor subscribed span state, resolve-lock checking, slow-region logging, and related metricsThe goal of this change is structural only:
subscription_client.go