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

region_cache: in some cases, LocateBucket should not return nil. #486

Merged
merged 2 commits into from
May 7, 2022

Conversation

SpadeA-Tang
Copy link
Member

@SpadeA-Tang SpadeA-Tang commented May 7, 2022

When key is in [region startkey, first bucket key) or [last bucket key, region endkey), it's better not to return nil, as they can be considered to be Bucket.

Signed-off-by: SpadeA-Tang <u6748471@anu.edu.au>
@youjiali1995 youjiali1995 merged commit 3705989 into tikv:master May 7, 2022
// it will return Bucket{KeyLocation.StartKey, first Bucket key} rather than nil --- it's reasonable to assume that
// Bucket{KeyLocation.StartKey, first Bucket key} is a bucket belonging to the region. Key in [last Bucket key, KeyLocation.EndKey)
// is handled similarly.
func (l *KeyLocation) LocateBucketV2(key []byte) *Bucket {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does V2 suppose to mean? Does that mean there would be two versions of the LocateBucket function and they would be used in different situations? If so it's better to change the name to some meaningful name but not use V2.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants