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

kv: enforce minimum value for kv.range_descriptor_cache.size #101129

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/kv/kvclient/kvcoord/dist_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ var rangeDescriptorCacheSize = settings.RegisterIntSetting(
"kv.range_descriptor_cache.size",
"maximum number of entries in the range descriptor cache",
1e6,
func(v int64) error {
// Set a minimum value to avoid a cache that is too small to be useful.
const minVal = 64
if v < minVal {
return errors.Errorf("cannot be set to a value less than %d", minVal)
}
return nil
},
)

// senderConcurrencyLimit controls the maximum number of asynchronous send
Expand Down