forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split: only retain safe sql key samples
Previously, the weighted load split finder could retain samples for any key that was a start key of a request span. This was problematic as the split key which is used, always has user column suffixes removed by calling `keys.EnsureSafeSplitKey` - meaning that it was possible for every sampled key to refer to the same key after this call. We could convert every incoming key into the safe split key, however this doesn't seem like a worthwhile trade off the additional overhead - as every request touches this hot path. This patch updates the sampling logic to always store the safe split key when a sampled key is replaced or added. The samples may still contain only a single key, however now it is much more likely that we will log due imbalance (all requests to the RHS) and bump the split finder no split key metrics. Release note: None
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters