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

api: fix scan regions #1648

Merged
merged 6 commits into from
Jul 24, 2019
Merged

api: fix scan regions #1648

merged 6 commits into from
Jul 24, 2019

Conversation

Luffbee
Copy link
Contributor

@Luffbee Luffbee commented Jul 23, 2019

What problem does this PR solve?

ScanRegionsByKey cannot find the region with key range [s, d), s < startKey < d.

What is changed and how it works?

The reason for the problem is this region is Less than startKey.
To solve it, first try to use find() get this region, then use this region as the startItem.

Check List

Tests

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

Code changes

  • Has configuration change
  • Has HTTP API interfaces 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 update the tidb-ansible repository
  • Need to be included in the release notes

@disksing
Copy link
Contributor

Please cleanup go.mod and go.sum

@nolouch nolouch changed the title Fix scan regions api: fix scan regions Jul 24, 2019
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM

@nolouch nolouch added needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. labels Jul 24, 2019
@disksing disksing merged commit 04b9bff into tikv:master Jul 24, 2019
@Luffbee Luffbee deleted the fix-scan-regions branch July 25, 2019 09:55
nolouch pushed a commit to nolouch/pd that referenced this pull request Aug 5, 2019
* fix scan regions bug: [s,d), s < key < d not found

* add one more test

* cleanup go.mod go.sum

* change semantic of ScanRange* from 'contain' to 'intersect'
@nolouch nolouch mentioned this pull request Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants