Skip to content

Updates to RecordDataHeader#1840

Merged
TedHartMS merged 14 commits into
mainfrom
tedhar/rdh-valueLen
Jun 2, 2026
Merged

Updates to RecordDataHeader#1840
TedHartMS merged 14 commits into
mainfrom
tedhar/rdh-valueLen

Conversation

@TedHartMS

Copy link
Copy Markdown
Contributor

This pull request updates the codebase to use the DataHeader property instead of the Info and RecordDataHeader properties for accessing metadata on log records. This change improves consistency and prepares the code for future enhancements by centralizing metadata access. Additionally, it updates documentation and value range logic for value overflow thresholds.

Key changes include:

Refactoring to use DataHeader:

  • Make RecordDataHeader fixed 16 bytes, with keys and values fixed at 12 and 22 bits respectively for length, instead of variable-bytelen. Anything over this becomes overflow.

  • Replaced all usages of logRecord.Info and logRecord.RecordDataHeader with logRecord.DataHeader for properties like ValueIsObject, HasExpiration, HasETag, ValueIsInline, and RecordType throughout the codebase, including in expiration checks, type checks, and record management logic. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

Documentation and configuration updates:

  • Updated comments and logic in GarnetServerOptions.cs to clarify and adjust the allowed value range for ValueOverflowThresholdBytes, now using a direct value with new min/max constants.

Other codebase updates:

  • Removed unnecessary clearing of ETag in InitialDeleter, likely because the new DataHeader abstraction handles this elsewhere.

These updates should make metadata handling more robust and less error-prone by consolidating access patterns.

@TedHartMS TedHartMS requested review from badrishc and Copilot June 1, 2026 02:37
@TedHartMS TedHartMS changed the title Tedhar/rdh value len Updates to RecordDataHeader Jun 1, 2026

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@badrishc badrishc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we have inline thresholds more like this: 1 KB keys (10 bits) + 16 MB values (24 bits) = 34 bits

@TedHartMS TedHartMS merged commit 3fa30c1 into main Jun 2, 2026
187 checks passed
@TedHartMS TedHartMS deleted the tedhar/rdh-valueLen branch June 2, 2026 04:34
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