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

processor: fix task status is always flushed because of incorrect mod revision cache (#1017) #1019

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #1017 to release-4.0


What problem does this PR solve?

After investigating the https://github.com/pingcap/ticdc/issues/993, found key /tidb/cdc/task/status/<capture-id>/<changefeed-id> is always updated when processor calls flushTaskStatusAndPosition

This bug happens since v4.0.5

What is changed and how it works?

The fix is straightforward, check newModRevision returned by AtomicPutTaskStatus, newModRevision=0 means status is not updated, we don't update the mod revision cache.

Check List

Tests

  • Unit test
  • Integration test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Fix a bug that processor always flushes task status to the etcd because of incorrect mod revision cache.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added type/bugfix This PR fixes a bug. status/ptal Could you please take a look? release-blocker This issue blocks a release. Please solve it ASAP. type/4.0-cherry-pick labels Oct 22, 2020
@ti-srebot ti-srebot added this to the v4.0.8 milestone Oct 22, 2020
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.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 22, 2020
@amyangfei
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 22, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (release-4.0@09c1fd6). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             release-4.0      #1019   +/-   ##
================================================
  Coverage               ?   31.5641%           
================================================
  Files                  ?        101           
  Lines                  ?      11041           
  Branches               ?          0           
================================================
  Hits                   ?       3485           
  Misses                 ?       7160           
  Partials               ?        396           

@ti-srebot ti-srebot merged commit 473e9cb into pingcap:release-4.0 Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker This issue blocks a release. Please solve it ASAP. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants