kafka: unify sink errors and replace failpoint tests (#5786) - #5815
kafka: unify sink errors and replace failpoint tests (#5786)#5815ti-chi-bot wants to merge 1 commit into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@3AceShowHand This PR has conflicts, I have hold it. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
close by #5811 |
This is an automated cherry-pick of #5786
What problem does this PR solve?
Kafka sink errors are overly fine-grained and inconsistently wrapped. Some propagation paths add multiple TiCDC error codes, lose the original cause, or use an error category owned by another sink. This makes retry classification and troubleshooting harder.
Kafka producer failure tests also rely on failpoints even when the behavior can be covered by focused unit tests and real Kafka failures.
Issue Number: close #5790
What is changed and how it works?
ErrKafkaInvalidConfig.ErrKafkaAdminAPI.ErrKafkaSendMessage.ErrNewKafkaSinkandErrKafkaSinkClosed, and delete superseded Kafka error definitions.The Kafka failpoints are removed without dropping their behavioral coverage:
KafkaSinkAsyncSendError: replaced by a real broker-rejection scenario inkafka_big_messages. The producer starts with a large topic limit, the test lowers the broker-side topic limit, and Kafka rejects an already-enqueued message through SaramaErrors(). The test checksErrKafkaSendMessage, warning-to-normal recovery, replay, and final data consistency.AsyncRunCallbackerror makessink.Runreturn the error and mark the sink abnormal without depending on Sarama.KafkaSinkSyncSendMessageError: single-message failure, cause preservation, and singleErrKafkaSendMessagewrapping are covered byTestSyncProducerErrorWrappedOnce.KafkaSinkSyncSendMessagesError: batch failure, cause preservation, and singleErrKafkaSendMessagewrapping are covered byTestSyncProducerErrorWrappedOnce.BuildEventLogContextunit tests.Check List
Tests
The Kafka integration scenario requires the repository Linux test environment and is left for CI; local unit tests, shell validation, and static checks pass on macOS/ARM.
Questions
Will it cause performance regression or break compatibility?
No performance regression is expected. This PR intentionally removes obsolete exported Kafka error variables and changes affected RFC codes and messages; compatibility aliases are not retained.
Do you need to update user documentation, design documentation or monitoring documentation?
No user-facing documentation or monitoring changes are required.
Release note
Summary by CodeRabbit
Bug Fixes
Tests