Revise Garnet's MaxInlineKeySize and MaxInlineValueSize config settings#1904
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates Garnet’s configuration surface for inline storage limits by replacing the single ValueOverflowThreshold setting with two distinct settings: MaxInlineKeySize and MaxInlineValueSize. The change flows through CLI/JSON config parsing, server option materialization into Tsavorite KVSettings, and corresponding configuration tests.
Changes:
- Introduces
MaxInlineKeySizeandMaxInlineValueSizeoptions (CLI + defaults) and wires them into TsavoriteKVSettings. - Adds/updates parsing and validation helpers in
GarnetServerOptionsfor the new settings, including page-fit constraints for inline values. - Refactors config tests to cover new options, defaults, and validation behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| test/standalone/Garnet.test/GarnetServerConfigTests.cs | Updates config parsing/validation tests for the new inline key/value size settings. |
| libs/storage/Tsavorite/cs/src/core/Index/Common/KVSettings.cs | Introduces new default constants and updates inline key/value settings defaults in Tsavorite settings. |
| libs/server/Servers/GarnetServerOptions.cs | Replaces ValueOverflowThreshold plumbing with MaxInlineKeySize/MaxInlineValueSize and adds helper validation/parsing. |
| libs/host/defaults.conf | Replaces the old config entry with the two new settings and updated documentation comments. |
| libs/host/Configuration/Options.cs | Adds CLI options and help text for the new settings and maps them into GarnetServerOptions. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
badrishc
approved these changes
Jun 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors and enhances the configuration of inline key and value sizes for the main log, replacing the previous
ValueOverflowThresholdsetting with two more granular options:MaxInlineKeySizeandMaxInlineValueSize. These changes provide clearer separation and validation for key and value inline storage limits, improving configurability and future extensibility.Configuration changes:
ValueOverflowThresholdoption with two new options:MaxInlineKeySize(max inline key size, default 1022 bytes) andMaxInlineValueSize(max inline value size, default min(1MB, PageSize/2)), updating all related configuration files and help texts. [1] [2] [3] [4]Validation and parsing logic:
MaxInlineKeySizeandMaxInlineValueSize, including range checks and handling of defaults, ensuring that configured values are within allowed boundaries and fit within the page size constraints.Internal settings and defaults:
KVSettingsto define and use new default constants for maximum inline key and value sizes, and ensured all code paths now reference these new options instead of the old threshold. [1] [2]