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

Support BatchScanRegions which loads non-continuous regions in one RPC #8307

Closed
you06 opened this issue Jun 19, 2024 · 0 comments · Fixed by #8300
Closed

Support BatchScanRegions which loads non-continuous regions in one RPC #8307

you06 opened this issue Jun 19, 2024 · 0 comments · Fixed by #8300
Labels
type/development The issue belongs to a development tasks

Comments

@you06
Copy link
Contributor

you06 commented Jun 19, 2024

Development Task

Sometimes, the client need to locate non-continuous key ranges. Current PD has no good solution for this requirement.

There are 2 workaround:

  1. Use GetRegion to load region one by one, check if the ranges are drained eachtime.
  2. Use ScanRegion to load (ranges[0].start, ranges[len(ranges)-1].end), which can cause unexpected traffics (imagine the ranges[0] is the first row and ranges[len(ranges)-1] is the last row of a large table).

Thus a interface BatchScanRegions is required.

It returns multi regions like ScanRegion, but accept a key range slice parameters. The returned regions are guaranteed to cover the given ranges if limitation is not reached.

@you06 you06 added the type/development The issue belongs to a development tasks label Jun 19, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jun 20, 2024
close #8307, ref pingcap/tidb#53850

Add `BatchScanRegions` interface for pd-client.

Signed-off-by: you06 <[email protected]>

Co-authored-by: JmPotato <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/development The issue belongs to a development tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant