Skip to content

kafka(ticdc): ddl sink close the underline sink if send ddl or checkpoint failed and refactor the kafka ddl sink (#12112)#12677

Merged
ti-chi-bot[bot] merged 3 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-12112-to-release-8.5
Jun 11, 2026
Merged

kafka(ticdc): ddl sink close the underline sink if send ddl or checkpoint failed and refactor the kafka ddl sink (#12112)#12677
ti-chi-bot[bot] merged 3 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-12112-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #12112

What problem does this PR solve?

Issue Number: close #12666, close #12096

What is changed and how it works?

  • owner/ddl_sink should close if meet any error, and rebuilt by the retry.
  • kafka factory implementations should wrap error immediately, and caller should just return error, no need to trace the error.
  • kafka ddl sink use encoder directly, instead of encoderBuilder
  • syncProducer no need to close in a goroutine, since it only deliver one message at a time, won't be blocked if the downstream kafka cluster unavailable.

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

`None`

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Jun 5, 2026
@ti-chi-bot

Copy link
Copy Markdown
Member Author

@3AceShowHand This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot

ti-chi-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

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 ti-community-infra/tichi repository.

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

Copy link
Copy Markdown

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 refactors the DDL sink to close the underlying sink upon failure and wraps Kafka send errors at the producer level. However, there are critical issues that must be addressed: unresolved git conflict markers are present in multiple files, including mq_ddl_sink.go and pulsar_ddl_sink.go. Additionally, a redundant import alias cerror was introduced in pkg/sink/kafka/v2/factory.go which should be replaced with the existing errors import.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cdc/sink/ddlsink/mq/mq_ddl_sink.go Outdated
Comment thread cdc/sink/ddlsink/mq/pulsar_ddl_sink.go Outdated
Comment thread pkg/sink/kafka/v2/factory.go Outdated
Comment thread pkg/sink/kafka/v2/factory.go Outdated
Comment thread pkg/sink/kafka/v2/factory.go Outdated
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.96296% with 10 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.5@a69a385). Learn more about missing BASE report.

Additional details and impacted files
Components Coverage Δ
cdc 57.6082% <0.0000%> (?)
dm 50.6011% <0.0000%> (?)
engine 50.7275% <0.0000%> (?)
Flag Coverage Δ
cdc 57.6082% <62.9629%> (?)
unit 54.0094% <62.9629%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             release-8.5     #12677   +/-   ##
================================================
  Coverage               ?   54.0094%           
================================================
  Files                  ?       1027           
  Lines                  ?     139496           
  Branches               ?          0           
================================================
  Hits                   ?      75341           
  Misses                 ?      58563           
  Partials               ?       5592           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot Bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Jun 5, 2026
@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 5, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand

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

The pull request process is described 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 approved label Jun 5, 2026
@3AceShowHand

Copy link
Copy Markdown
Contributor

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2026
@3AceShowHand

Copy link
Copy Markdown
Contributor

/retest

@lidezhu

lidezhu commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

/hold

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2026
@3AceShowHand

Copy link
Copy Markdown
Contributor

/hold

@3AceShowHand

Copy link
Copy Markdown
Contributor

/retest

@lidezhu

lidezhu commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 11, 2026
@ti-chi-bot ti-chi-bot Bot merged commit 38143d8 into pingcap:release-8.5 Jun 11, 2026
27 checks passed
@ti-chi-bot ti-chi-bot Bot deleted the cherry-pick-12112-to-release-8.5 branch June 11, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants