Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mq(ticdc): implement producer interfrace using kafka-go #8146

Merged
merged 13 commits into from
Feb 1, 2023

Conversation

sdojjy
Copy link
Member

@sdojjy sdojjy commented Jan 31, 2023

What problem does this PR solve?

Issue Number: close #8145

What is changed and how it works?

implement producer using kafka-go

Check List

Tests

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

Questions

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

Release note

 `None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 31, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • hi-rustin

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 31, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 31, 2023
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Thanks!

pkg/sink/kafka/v2/kafka-go-client.go Outdated Show resolved Hide resolved
changefeedID := contextutil.ChangefeedIDFromCtx(ctx)
var role string
if contextutil.IsOwnerFromCtx(ctx) {
role = util.RoleOwner.String()
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a role in the context? For now, the owner always uses a sync writer to write DDL and the processor always uses an async writer to write DML.

Copy link
Member Author

Choose a reason for hiding this comment

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

here, use the role to genereate kafka client ID , like sarama implementation

Copy link
Member

Choose a reason for hiding this comment

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

What happened if we have more than one processor?

Copy link
Member Author

Choose a reason for hiding this comment

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

the clientID is the same if we have more than one processor, it is the same logic with sarama

Copy link
Member

Choose a reason for hiding this comment

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

So we don't need to add the role to the client ID. Because it is useless.

pkg/sink/kafka/v2/kafka-go-client.go Outdated Show resolved Hide resolved
pkg/sink/kafka/v2/kafka-go-client.go Show resolved Hide resolved
pkg/sink/kafka/v2/kafka-go-client.go Show resolved Hide resolved
pkg/sink/kafka/v2/kafka-go-client.go Show resolved Hide resolved
pkg/sink/kafka/v2/kafka-go-client.go Outdated Show resolved Hide resolved
pkg/sink/kafka/v2/kafka-go-client.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 1, 2023
@sdojjy
Copy link
Member Author

sdojjy commented Feb 1, 2023

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2afd9d7

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 1, 2023
@sdojjy
Copy link
Member Author

sdojjy commented Feb 1, 2023

/run-engine-integration-tests

@ti-chi-bot ti-chi-bot merged commit 2eaad2d into pingcap:master Feb 1, 2023
@sdojjy sdojjy deleted the kafka-go-producer branch February 2, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement kafka-go based client
5 participants