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

fix seekLeaderStore NPE #366

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

iosmanthus
Copy link
Member

What problem does this PR solve?

This pull request fixes the NPE triggered by the double retry of seekLeaderStore. These buggy lines would also introduce another issue like peer id not match because the meta of the region is not updated.

What is changed and how it works?

Once we change detected a reachable store we need to update the peer information of the region and retry in the most outside code.

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

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

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

Signed-off-by: iosmanthus <[email protected]>
Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

@marsishandsome
Copy link
Collaborator

/run-all-tests

@zz-jason
Copy link
Member

zz-jason commented Dec 7, 2021

@iosmanthus please remove the necessary checks in PR description

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

could you add some tests?

@iosmanthus
Copy link
Member Author

could you add some tests?

It is really hard to inject the error to trigger a double retry of seekLeaderStore. We can only use integration to cover this case.

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason merged commit 1dd7cba into tikv:master Dec 9, 2021
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Dec 9, 2021
@ti-srebot
Copy link
Collaborator

cherry pick to release-3.1 in PR #371

zz-jason pushed a commit that referenced this pull request Dec 9, 2021
ankita25 pushed a commit to ankita25/client-java that referenced this pull request Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants