Skip to content

kafka: make the verify lightweight (#5617) - #5811

Merged
ti-chi-bot[bot] merged 10 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-5617-to-release-8.5
Jul 30, 2026
Merged

kafka: make the verify lightweight (#5617)#5811
ti-chi-bot[bot] merged 10 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-5617-to-release-8.5

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot commented Jul 29, 2026

Copy link
Copy Markdown
Member

This PR backports #5617 to release-8.5.

What problem does this PR solve?

Issue Number: close #5618, ref #5719, ref #5720, ref #5790

This PR brings a related set of Kafka fixes from master to release-8.5 in one backport:

  • Kafka sink verification should stay lightweight and avoid constructing runtime-only components.
  • Claim-check storage should be shared by all encoders owned by one sink.
  • replication-factor should be validated when TiCDC needs to create a topic, not for an existing topic.
  • Kafka sink errors should use the unified TiCDC pkg/errors definitions and preserve the same error behavior as master.

What is changed and how it works?

#5617 / #5811: lightweight Kafka verification

  • Runs the shared protocol, topic, sink-option, encoder, router, and column-selector validation directly.
  • Uses Kafka admin metadata and validate-only topic creation without creating a topic during verification.
  • Leaves real topic creation to normal sink startup.
  • Removes the test-only Kafka factory creator indirection.

Additional cherry-picks carried by this PR

Check List

Tests

  • Unit test

Commands run locally:

go test --tags=intest ./pkg/sink/kafka ./downstreamadapter/sink/kafka ./downstreamadapter/sink/topicmanager -count=1
go test --run '^$' --tags=intest ./...
bash -n tests/integration_tests/kafka_big_messages/run.sh
git diff --check

Questions

Will it cause performance regression or break compatibility?

No performance regression is expected. Lightweight verification avoids startup-only work, and sharing one claim-check instance reduces duplicated resources. Kafka error classification is aligned with master; no user-facing Kafka configuration or protocol format is changed by this PR.

Do you need to update user documentation, design documentation or monitoring documentation?

No. These are internal Kafka sink verification, lifecycle, validation, and error-handling changes.

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 Jul 29, 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 Jul 29, 2026

Copy link
Copy Markdown

@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.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@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 Jul 30, 2026
…5617-to-release-8.5

# Conflicts:
#	downstreamadapter/sink/kafka/helper.go
@ti-chi-bot

Copy link
Copy Markdown
Member Author

Cherry-pick conflicts appear resolved; removing the do-not-merge/hold label.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ac8de7ca-80d8-4a45-a80b-8bc70e0b2885

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2026
…-to-release-8.5

# Conflicts:
#	downstreamadapter/sink/kafka/helper.go
#	downstreamadapter/sink/kafka/sink.go
#	downstreamadapter/sink/kafka/sink_test.go
…-to-release-8.5

# Conflicts:
#	downstreamadapter/sink/kafka/sink.go
#	downstreamadapter/sink/kafka/sink_test.go
#	downstreamadapter/sink/topicmanager/kafka_topic_manager_test.go
#	pkg/sink/kafka/options_test.go
…-to-release-8.5

# Conflicts:
#	downstreamadapter/sink/kafka/helper.go
#	downstreamadapter/sink/kafka/sink.go
#	downstreamadapter/sink/kafka/sink_test.go
#	downstreamadapter/sink/topicmanager/kafka_topic_manager.go
#	downstreamadapter/sink/topicmanager/kafka_topic_manager_test.go
#	pkg/sink/kafka/admin_test.go
#	pkg/sink/kafka/claimcheck/claim_check_test.go
#	pkg/sink/kafka/cluster_admin_client_mock.go
#	pkg/sink/kafka/options.go
#	pkg/sink/kafka/options_test.go
#	pkg/sink/kafka/sarama_sync_producer_test.go
@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 30, 2026
@3AceShowHand

Copy link
Copy Markdown
Collaborator

/test all

@3AceShowHand

Copy link
Copy Markdown
Collaborator

/test all

@ti-chi-bot ti-chi-bot Bot added the approved label Jul 30, 2026
@3AceShowHand

Copy link
Copy Markdown
Collaborator

/retest

@3AceShowHand

Copy link
Copy Markdown
Collaborator

/test all

@ti-chi-bot

ti-chi-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, nongfushanquan

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:
  • OWNERS [3AceShowHand,nongfushanquan]

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

@3AceShowHand

Copy link
Copy Markdown
Collaborator

/retest

1 similar comment
@3AceShowHand

Copy link
Copy Markdown
Collaborator

/retest

@ti-chi-bot
ti-chi-bot Bot merged commit 7aced84 into pingcap:release-8.5 Jul 30, 2026
17 checks passed
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/XXL Denotes a PR that changes 1000+ 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