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

store/tikv: pre-split regions during 2PC to avoid hotspot (#16920) #16959

Merged
merged 3 commits into from
May 6, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 30, 2020

cherry-pick #16920 to release-4.0


What problem does this PR solve?

Issue Number: close #16573

Problem Summary:

Pre-split region before it become a writing hotspot to avoid the TiKV 'server is busy' error.

What is changed and how it works?

What's Changed:

Pre-split the region during 2PC if we detect there are many mutations into one region.

How it Works:

Call the store.SplitRegions and store.WaitScatterRegionFinish API.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

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

http://172.16.4.61:13000/d/000000011/test-cluster-tidb?orgId=1&from=1588073060157&to=1588082547757

Release note

During the two phase commit process, if there are a lot of mutations within a single region, pre-split that region to avoid hotspot.

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

/run-all-tests

@tiancaiamao
Copy link
Contributor

/run-integration-copr-test

@tiancaiamao
Copy link
Contributor

PTAL @lysu @jackysp

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@tiancaiamao
Copy link
Contributor

/rebuild

@jackysp
Copy link
Member

jackysp commented Apr 30, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 30, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

Your auto merge job has been accepted, waiting for:

  • 16915

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 30, 2020

@sre-bot merge failed.

@jackysp
Copy link
Member

jackysp commented May 1, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented May 1, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented May 1, 2020

@sre-bot merge failed.

@jackysp
Copy link
Member

jackysp commented May 5, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented May 5, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented May 5, 2020

@sre-bot merge failed.

@coocood
Copy link
Member

coocood commented May 6, 2020

/run-integration-copr-test

@tiancaiamao
Copy link
Contributor

/run-all-tests

Copy link
Member

@coocood coocood left a comment

Choose a reason for hiding this comment

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

LGTM

@coocood coocood merged commit fecb0c9 into pingcap:release-4.0 May 6, 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. type/enhancement The issue or PR belongs to an enhancement. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants