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

cdc: remove downstreams correctly when uninitialized #12262

Merged
merged 3 commits into from
Mar 25, 2022

Conversation

hicqu
Copy link
Contributor

@hicqu hicqu commented Mar 25, 2022

Signed-off-by: qupeng [email protected]

What is changed and how it works?

#11896 (comment) introduces a critical bug for CDC, which can cause data lost or downstreams blocking forever. Here is how to trigger the bug:

  1. multiple downstreams subscribe one region
  2. cancel one downstream before the region delegate has been initialized

Then, Delegate::stop_observing will be called incorrectly and all change events will be lost.

This PR does

  1. correct the bug
  2. add a log for stop_observing
  3. complete unit tests for Delegate::subscribe and Delegate::unsubscribe.
cdc: remove downstreams correctly when uninitialized

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hi-rustin
  • overvenus

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 the release-note-none Denotes a PR that doesn't merit a release note. label Mar 25, 2022
@hicqu hicqu requested review from overvenus and Rustin170506 March 25, 2022 05:26
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2022
@hicqu hicqu added type/bugfix This PR fixes a bug. affects-6.0 needs-cherry-pick-release-6.0 and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 25, 2022
@hicqu
Copy link
Contributor Author

hicqu commented Mar 25, 2022

/test

Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

Rest LGTM

components/cdc/src/delegate.rs Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 25, 2022
@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 25, 2022
Signed-off-by: qupeng <[email protected]>
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2022
@ti-chi-bot
Copy link
Member

[FORMAT CHECKER NOTIFICATION]

Notice: Please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456, multiple issues should use full syntax for each issue and be separated by a comma, like: Issue Number: close #123, ref #456.

📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md.

@hicqu
Copy link
Contributor Author

hicqu commented Mar 25, 2022

/merge

@ti-chi-bot
Copy link
Member

@hicqu: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

@ti-chi-bot
Copy link
Member

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

Commit hash: 455f259

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

/merge

@hicqu hicqu merged commit 7c10093 into tikv:master Mar 25, 2022
@hicqu hicqu deleted the cdc-datalost branch March 25, 2022 08:33
ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Mar 25, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-6.0 in PR #12268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.0 needs-cherry-pick-release-6.0 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants