Problem
Kafka sink errors are overly fine-grained and inconsistently wrapped. Configuration, Admin API, and producer failures can acquire multiple TiCDC error codes or lose their original cause while propagating. Some paths also use errors from the wrong component, which makes retry classification and troubleshooting harder.
Proposed changes
- Consolidate configuration errors into
ErrKafkaInvalidConfig.
- Consolidate Admin API errors into
ErrKafkaAdminAPI.
- Consolidate producer send errors into
ErrKafkaSendMessage.
- Add sink-level creation and closed errors, and remove superseded Kafka error definitions.
- Wrap third-party errors once at the boundary where their semantic category is known; return wrapped and context errors directly afterward.
- Correct errors that are categorized under the wrong sink component.
- Replace Kafka failpoint-only error tests with focused unit tests where practical.
Problem
Kafka sink errors are overly fine-grained and inconsistently wrapped. Configuration, Admin API, and producer failures can acquire multiple TiCDC error codes or lose their original cause while propagating. Some paths also use errors from the wrong component, which makes retry classification and troubleshooting harder.
Proposed changes
ErrKafkaInvalidConfig.ErrKafkaAdminAPI.ErrKafkaSendMessage.