Skip to content

kafka: simplify and unify sink errors #5790

Description

@3AceShowHand

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions