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: move region_* into package store/tikv/region #25205

Merged
merged 13 commits into from
Jun 10, 2021

Conversation

AndreMouche
Copy link
Contributor

Signed-off-by: AndreMouche

What problem does this PR solve?

This PR moves tikv/region_*.go into package store/tikv/region

Part of #22513

Check List

Tests

  • Unit test

Release note

  • No release note

@AndreMouche AndreMouche added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2021
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jun 7, 2021
@AndreMouche AndreMouche force-pushed the tikv/region branch 2 times, most recently from bd54680 to fbd3f10 Compare June 7, 2021 08:06
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
@AndreMouche AndreMouche requested a review from a team as a code owner June 8, 2021 08:02
@AndreMouche AndreMouche requested review from wshwsh12 and removed request for a team June 8, 2021 08:02
@AndreMouche
Copy link
Contributor Author

/run-all-tests

@github-actions github-actions bot added the sig/execution SIG execution label Jun 8, 2021
@AndreMouche AndreMouche added the sig/transaction SIG:Transaction label Jun 8, 2021
Comment on lines 13 to 58
// RPCContext contains data that is needed to send RPC to a region.
type RPCContext = region.RPCContext

// RPCCanceller is rpc send cancelFunc collector.
type RPCCanceller = region.RPCCanceller

// RegionVerID is a unique ID that can identify a Region at a specific version.
type RegionVerID = region.VerID

// RegionCache caches Regions loaded from PD.
type RegionCache = region.Cache

// KeyLocation is the region and range that a key is located.
type KeyLocation = region.KeyLocation

// RPCCancellerCtxKey is context key attach rpc send cancelFunc collector to ctx.
type RPCCancellerCtxKey = region.RPCCancellerCtxKey

// RegionRequestSender sends KV/Cop requests to tikv server. It handles network
// errors and some region errors internally.
//
// Typically, a KV/Cop request is bind to a region, all keys that are involved
// in the request should be located in the region.
// The sending process begins with looking for the address of leader store's
// address of the target region from cache, and the request is then sent to the
// destination tikv server over TCP connection.
// If region is updated, can be caused by leader transfer, region split, region
// merge, or region balance, tikv server may not able to process request and
// send back a RegionError.
// RegionRequestSender takes care of errors that does not relevant to region
// range, such as 'I/O timeout', 'NotLeader', and 'ServerIsBusy'. For other
// errors, since region range have changed, the request may need to split, so we
// simply return the error to caller.
type RegionRequestSender = region.RequestSender

// StoreSelectorOption configures storeSelectorOp.
type StoreSelectorOption = region.StoreSelectorOption

// RegionRequestRuntimeStats records the runtime stats of send region requests.
type RegionRequestRuntimeStats = region.RequestRuntimeStats

// RPCRuntimeStats indicates the RPC request count and consume time.
type RPCRuntimeStats = region.RPCRuntimeStats

// CodecPDClient wraps a PD Client to decode the encoded keys in region meta.
type CodecPDClient = region.CodecPDClient
Copy link
Contributor

@andylokandy andylokandy Jun 8, 2021

Choose a reason for hiding this comment

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

What's the reason for reexporting these types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we do not want the client to care about the sub-packages

@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 9, 2021
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 9, 2021
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Jun 9, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 9, 2021
Signed-off-by: shirly <AndreMouche@126.com>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • sticnarf

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 10, 2021
@AndreMouche
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: eb04de0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 10, 2021
@AndreMouche
Copy link
Contributor Author

/run-unit-test

@AndreMouche
Copy link
Contributor Author

/run-integration-common-test

@zhouqiang-cl
Copy link
Contributor

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit 37472dc into pingcap:master Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants