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

owner: wait all task metadata cleaned before creating new changefeed (#1212) #1213

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #1212 to release-4.0


What problem does this PR solve?

Fix https://github.com/pingcap/ticdc/issues/1211

Root cause: There exists race condition when CDC owner creates a new changefeed (which will assign new task status) and a stale processor stops (which is responsible for replicating the same changefeed). The latest task status written by owner could be deleted by a stale processor.

What is changed and how it works?

This PR changes the update of task status to a linearizable way, which means a paused/removed task status can be deleted, but cannot be put.

TODO: We should summary the schedule model of CDC owner and processor to make it works in a provable automaton.

Check List

Tests

  • Unit test
  • Integration test

Release note

  • Fix a bug that some tables' row change could be lost when the network between CDC and PD has jitter, and there exist changefeed resume operation at the same time.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@zier-one
Copy link
Contributor

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 16, 2020
@zier-one
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 16, 2020
@zier-one
Copy link
Contributor

/merge

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 16, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit 03f224c into pingcap:release-4.0 Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants