Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the AOF record header encoding to make the “type” and other per-record indicators explicit: it renames the byte at offset 1 from padding to flags, packs AofHeaderType into masked bits, and adds flag bits intended for chunked records and FLUSH “unsafe truncate” behavior.
Changes:
- Replaced
paddingusage with aflagsbitfield and addedAofHeader.HeaderTypeaccessor for masked header-type encoding. - Replaced raw
unsafeTruncateLogbyte overlay with anUnsafeTruncateLogboolean accessor backed by a flag bit. - Updated AOF enqueue/replay codepaths (and the offline benchmark generator) to use the new accessors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/server/AOF/GarnetLog.cs | Updates AOF record enqueue paths to set HeaderType and UnsafeTruncateLog via the new header accessors. |
| libs/server/AOF/AofProcessor.cs | Updates replay logic to read HeaderType/UnsafeTruncateLog from flags rather than interpreting the old overlayed bytes. |
| libs/server/AOF/AofHeader.cs | Introduces flags bitfield, masks for header type, and boolean/accessor properties for header type and unsafe-truncate. |
| benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs | Adjusts benchmark AOF generation to use the new HeaderType accessor. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
badrishc
approved these changes
May 9, 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.
Also change 'padding' to 'flags' with reorganization of header bits for clarity