Skip to content

Replay of an inline overwrite must clear the VALUE_SEP sidecar - #12

Open
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b27-valsep-inline
Open

Replay of an inline overwrite must clear the VALUE_SEP sidecar#12
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b27-valsep-inline

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

apply_record only wrote the valsep sidecar on VALUE_SEP. A later inline put (live path: set_valsep(None)) left the hash in place. Crash-reopen of the unsealed active file then incr_ref + sweep_orphans kept the large blob, and the next seal wrote the stale hash into the footer. GET stayed correct. Two commits: a test that fails on main, then the fix.

  • Full inline records now set_valsep(None), matching apply_valsep_insert.

git checkout HEAD~1 && cargo test -p beyond-kv-engine --lib crash_after_large_then_small fails; HEAD passes.

apply_record only writes the valsep sidecar on VALUE_SEP, so an inline overwrite leaves the hash. Reopen then sweep_orphans keeps the blob. This fails on current main.
Match the live write path: a full inline record sets valsep to None so crash replay + sweep_orphans does not resurrect the previous VALUE_SEP blob.
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.

1 participant