Skip to content

Revise Garnet's MaxInlineKeySize and MaxInlineValueSize config settings#1904

Merged
TedHartMS merged 5 commits into
mainfrom
tedhar/max-inline
Jun 30, 2026
Merged

Revise Garnet's MaxInlineKeySize and MaxInlineValueSize config settings#1904
TedHartMS merged 5 commits into
mainfrom
tedhar/max-inline

Conversation

@TedHartMS

Copy link
Copy Markdown
Contributor

This pull request refactors and enhances the configuration of inline key and value sizes for the main log, replacing the previous ValueOverflowThreshold setting with two more granular options: MaxInlineKeySize and MaxInlineValueSize. These changes provide clearer separation and validation for key and value inline storage limits, improving configurability and future extensibility.

Configuration changes:

  • Replaced the ValueOverflowThreshold option with two new options: MaxInlineKeySize (max inline key size, default 1022 bytes) and MaxInlineValueSize (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:

  • Implemented new parsing and validation logic for MaxInlineKeySize and MaxInlineValueSize, 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:

  • Updated KVSettings to 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]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 MaxInlineKeySize and MaxInlineValueSize options (CLI + defaults) and wires them into Tsavorite KVSettings.
  • Adds/updates parsing and validation helpers in GarnetServerOptions for 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.

Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
Comment thread test/standalone/Garnet.test/GarnetServerConfigTests.cs Outdated
Comment thread test/standalone/Garnet.test/GarnetServerConfigTests.cs Outdated
Comment thread test/standalone/Garnet.test/GarnetServerConfigTests.cs Outdated
Comment thread libs/storage/Tsavorite/cs/src/core/Index/Common/KVSettings.cs
Comment thread libs/server/Servers/GarnetServerOptions.cs Outdated
@TedHartMS TedHartMS merged commit 639b028 into main Jun 30, 2026
400 of 401 checks passed
@TedHartMS TedHartMS deleted the tedhar/max-inline branch June 30, 2026 16:01
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