Skip to content

Add chunked header indicator to AofHeader#1782

Merged
badrishc merged 11 commits into
mainfrom
tedhar/dev-fixes0508
May 11, 2026
Merged

Add chunked header indicator to AofHeader#1782
badrishc merged 11 commits into
mainfrom
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

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 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>
badrishc
badrishc previously approved these changes May 9, 2026
@badrishc badrishc changed the base branch from dev to main May 11, 2026 22:29
@badrishc badrishc dismissed their stale review May 11, 2026 22:29

The base branch was changed.

@badrishc badrishc merged commit 448ea6e into main May 11, 2026
5 checks passed
@badrishc badrishc deleted the tedhar/dev-fixes0508 branch May 11, 2026 22:38
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.

4 participants