Skip to content

kafka: bump sarama version and enable the retry to fix the broken pipe and out of order#12618

Open
3AceShowHand wants to merge 12 commits into
pingcap:masterfrom
3AceShowHand:sarama-broken-pipe
Open

kafka: bump sarama version and enable the retry to fix the broken pipe and out of order#12618
3AceShowHand wants to merge 12 commits into
pingcap:masterfrom
3AceShowHand:sarama-broken-pipe

Conversation

@3AceShowHand
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 22, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 22, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hongyunyan for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 22, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the manual heartbeat and connection keep-alive logic across Kafka sinks and managers, including the removal of the HeartbeatBrokers method and KeepConnAliveInterval configuration. It also updates the sarama dependency and increases the producer's maximum retry count to 5. A review comment suggests updating the documentation in pkg/sink/kafka/sarama.go to reflect whether the previously mentioned ordering issues with retries have been resolved in the new version.

Comment thread pkg/sink/kafka/sarama.go Outdated
Comment on lines +61 to +64
// According to the https://github.com/IBM/sarama/issues/2619,
// sarama may send message out of order even set the `config.Net.MaxOpenRequest` to 1,
// when the kafka cluster is unhealthy and trigger the internal retry mechanism.
config.Producer.Retry.Max = 0
config.Producer.Retry.Max = 5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on lines 61-63 warns that enabling retries in Sarama can lead to out-of-order messages even when MaxOpenRequests is set to 1. However, this PR increases Retry.Max to 5, and the title suggests this change (along with the Sarama version bump) is intended to fix out-of-order issues.

If the ordering issue in Sarama during retries has been fixed in the bumped version or the PingCAP fork, please update or remove this comment to reflect the current state. If the issue persists, enabling retries might re-introduce the ordering problem mentioned in the warning.

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented May 8, 2026

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.

@3AceShowHand
Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@3AceShowHand
Copy link
Copy Markdown
Contributor Author

/retest

@3AceShowHand
Copy link
Copy Markdown
Contributor Author

/retest

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented May 9, 2026

@3AceShowHand: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-dm-integration-test-next-gen 9d0e387 link false /test pull-dm-integration-test-next-gen

Full PR test history. Your PR dashboard.

Details

Instructions 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. I understand the commands that are listed here.

@3AceShowHand
Copy link
Copy Markdown
Contributor Author

/test pull-cdc-integration-storage-test

1 similar comment
@3AceShowHand
Copy link
Copy Markdown
Contributor Author

/test pull-cdc-integration-storage-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant