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

sink(ticdc): add GetActiveTopics support for event router #4743

Merged
merged 9 commits into from
Mar 7, 2022

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Mar 2, 2022

What problem does this PR solve?

Issue Number: ref #4423

What is changed and how it works?

  1. add GetActiveTopics support for event router. It will return the topic corresponding to each table (de-duplicated).
  2. pass table names to EmitCheckpointTs. It will also pass the tables in the schema that need to be synchronized at that time.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Side effects

None

Related changes

None

Release note


None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • amyangfei
  • zhaoxinyu

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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 2, 2022
@Rustin170506 Rustin170506 force-pushed the rustin-patch-sink-hooks branch 2 times, most recently from 5492128 to bbf7ee4 Compare March 3, 2022 06:07
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2022

Codecov Report

Merging #4743 (89fe2db) into master (9607554) will decrease coverage by 0.0829%.
The diff coverage is 52.4492%.

Flag Coverage Δ
cdc 59.7950% <52.4492%> (-0.1272%) ⬇️
dm 52.0460% <ø> (+0.0171%) ⬆️

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

@@               Coverage Diff                @@
##             master      #4743        +/-   ##
================================================
- Coverage   55.6402%   55.5572%   -0.0830%     
================================================
  Files           494        521        +27     
  Lines         61283      64393      +3110     
================================================
+ Hits          34098      35775      +1677     
- Misses        23750      25104      +1354     
- Partials       3435       3514        +79     

@Rustin170506
Copy link
Member Author

/run-all-tests

@Rustin170506 Rustin170506 force-pushed the rustin-patch-sink-hooks branch 3 times, most recently from a6f10c4 to aeb260f Compare March 3, 2022 11:56
@Rustin170506 Rustin170506 changed the title sink(ticdc): add OnTableSinkCreated and OnTableSinkDestroyed hooks for sink sink(ticdc): add GetActiveTopics support for event router Mar 4, 2022
@Rustin170506 Rustin170506 marked this pull request as ready for review March 4, 2022 09:16
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 4, 2022
partitionDispatcher partition.Dispatcher
topicDispatcher topic.Dispatcher
filter.Filter
}
}

// NewEventRouter creates a new EventRouter
func NewEventRouter(cfg *config.ReplicaConfig, defaultTopic string) (*EventRouter, error) {
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 check for defaultTopic is insufficient here, but it's not related to this PR, so I'll fix it in the next PR.

@Rustin170506
Copy link
Member Author

/run-integration-test /tikv=pr/12050
/run-kafka-integration-test /tikv=pr/12050

@Rustin170506
Copy link
Member Author

/run-leak-test
/run-verify

Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

Besides how does passing all table names solve the table missing problem

cdc/owner/schema.go Outdated Show resolved Hide resolved
cdc/owner/schema.go Outdated Show resolved Hide resolved
cdc/owner/schema_test.go Outdated Show resolved Hide resolved
@Rustin170506
Copy link
Member Author

Besides how does passing all table names solve the table missing problem

I think we just need to maintain all the table information that corresponds at that time? It is in the tick before the processing of the ddl, so can we assume that the tables that need to be synchronized at the current moment are those in AllTableNames?

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 7, 2022
cdc/owner/schema.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 7, 2022
@zhaoxinyu
Copy link
Contributor

/LGTM

@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 Mar 7, 2022
Copy link
Member Author

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

Self check

@Rustin170506
Copy link
Member Author

/hold

/cc @amyangfei

Please take a look again. Thanks!

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 7, 2022
@Rustin170506
Copy link
Member Author

/run-all-tests

@Rustin170506
Copy link
Member Author

/run-kafka-integration-test

@Rustin170506
Copy link
Member Author

/unhold

/merge

@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 Mar 7, 2022
@ti-chi-bot
Copy link
Member

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

Commit hash: d65308c

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 7, 2022
@ti-chi-bot
Copy link
Member

@hi-rustin: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@Rustin170506
Copy link
Member Author

/run-verify

@ti-chi-bot ti-chi-bot merged commit 54b129d into pingcap:master Mar 7, 2022
@Rustin170506 Rustin170506 deleted the rustin-patch-sink-hooks branch March 7, 2022 13:31
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/XXL Denotes a PR that changes 1000+ 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.

5 participants