Skip to content

fix(aof): chunk grown string values into SET and APPEND - #191

Merged
MohitGoyal09 merged 7 commits into
mainfrom
fix/140-aof-string-chunks
Nov 18, 2026
Merged

MohitGoyal09 merged 7 commits into
mainfrom
fix/140-aof-string-chunks

Conversation

@MohitGoyal09

@MohitGoyal09 MohitGoyal09 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #140

append_value wrote every string as a single SET, so a string grown past the 256 MiB protocol cap by APPEND produced an unreadable AOF and the server refused to start.

  • Strings above the 32 MiB replay budget are written as SET plus APPEND chunks, reusing the existing payload budget.
  • Unit tests check the command shapes, the exact 32 MiB boundary (one SET versus SET+APPEND), and total payload.
  • An integration test grows a value to 260 MiB with two APPENDs (different fill bytes), restarts from AOF, and asserts STRLEN plus seam and tail bytes; it fails on main.
  • docs/COMPATIBILITY.md states that APPEND-grown strings replay, SETRANGE stays capped at 64 MiB, older broken files still cannot load, and re-encoding costs grow until BGREWRITEAOF.

Verification

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test

All 40 test binaries pass.

Write strings above the replay budget as a SET plus APPEND chunks so values past
the 256 MiB protocol cap replay, and cover a 260 MiB grown string across a
restart.
@MohitGoyal09
MohitGoyal09 merged commit 3e6be42 into main Nov 18, 2026
6 checks passed
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.

Chunk string values in the AOF so grown keys can replay

1 participant