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

kv client: ignore prewrite event if value is empty #446

Merged
merged 3 commits into from
Apr 10, 2020

Conversation

zier-one
Copy link
Contributor

@zier-one zier-one commented Apr 9, 2020

What problem does this PR solve?

ignore prewrite event if value is empty

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

@zier-one
Copy link
Contributor Author

zier-one commented Apr 9, 2020

/run-integration-tests

@amyangfei amyangfei added type/bugfix This PR fixes a bug. component/kv-client TiKV kv log client component. labels Apr 9, 2020
@zier-one
Copy link
Contributor Author

zier-one commented Apr 9, 2020

/run-integration-tests

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

@amyangfei amyangfei added the LGT1 label Apr 9, 2020
value := row.GetValue()
// tikv may send a prewrite event with empty value
// here we need to avoid the invalid prewrite event overwrite the value
if _, exist := m.unmatchedValue[key]; exist && len(value) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

PTAL @5kbpers

Copy link
Contributor

@5kbpers 5kbpers left a comment

Choose a reason for hiding this comment

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

LGTM, I think it just is a workaround, better to mark the type of prewrite and commit in the future, then we could handle the situations like this more flexibly.

@zier-one zier-one merged commit 948879d into pingcap:master Apr 10, 2020
@zier-one zier-one deleted the add_log branch April 10, 2020 05:14
@zier-one zier-one restored the add_log branch April 10, 2020 05:14
@zier-one zier-one deleted the add_log branch April 10, 2020 05:14
5kbpers pushed a commit to 5kbpers/ticdc that referenced this pull request Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/kv-client TiKV kv log client component. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants