Skip to content

Add chunked header indicator to AofHeader#1782

Open
TedHartMS wants to merge 6 commits intodevfrom
tedhar/dev-fixes0508
Open

Add chunked header indicator to AofHeader#1782
TedHartMS wants to merge 6 commits intodevfrom
tedhar/dev-fixes0508

Conversation

@TedHartMS
Copy link
Copy Markdown
Contributor

Also change 'padding' to 'flags' with reorganization of header bits for clarity

Copilot AI review requested due to automatic review settings May 9, 2026 00:04
@TedHartMS TedHartMS requested review from badrishc and vazois May 9, 2026 00:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 padding usage with a flags bitfield and added AofHeader.HeaderType accessor for masked header-type encoding.
  • Replaced raw unsafeTruncateLog byte overlay with an UnsafeTruncateLog boolean 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.

Comment thread libs/server/AOF/AofHeader.cs Outdated
Comment thread libs/server/AOF/AofHeader.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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