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

kvserver: mvcc first split key should use local max when split key is lower than local max #104995

Open
kvoli opened this issue Jun 15, 2023 · 0 comments
Labels
A-kv-distribution Relating to rebalancing and leasing. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team

Comments

@kvoli
Copy link
Collaborator

kvoli commented Jun 15, 2023

Is your feature request related to a problem? Please describe.
We added a check to return no split key in MVCCFirstSplitKey when the range's start key is less than keys.LocalMax #104082.

This check means the function will not return a split key for range1, even though we may wish to split meta2 for load. In practice this probably isn't very common, as meta2 would be split out from size based splits.

The solution is to mirror MVCCFindSplitKey which bumps the start key to keys.LocalMax if not at or higher already.

cockroach/pkg/storage/mvcc.go

Lines 5864 to 5866 in 6235182

if key.Less(roachpb.RKey(keys.LocalMax)) {
key = roachpb.RKey(keys.LocalMax)
}

Jira issue: CRDB-28819

@kvoli kvoli added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team labels Jun 15, 2023
@kvoli kvoli added the A-kv-distribution Relating to rebalancing and leasing. label Jun 15, 2023
@kvoli kvoli self-assigned this Jun 15, 2023
@kvoli kvoli removed their assignment Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv-distribution Relating to rebalancing and leasing. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv KV Team
Projects
None yet
Development

No branches or pull requests

1 participant