Skip to content

store: replace undersized header.head instead of zeroing it - #268

Merged
reardencode merged 1 commit into
masterfrom
store/header-head-recreate
Aug 26, 2026
Merged

store: replace undersized header.head instead of zeroing it#268
reardencode merged 1 commit into
masterfrom
store/header-head-recreate

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

H2: open-grow of an undersized single-gen header.head used to zero_range the live OA file. A crash between zero and reinsert left an empty table that the next open treated as valid (silent index wipe).

Open now reads occupied slots, unlinks the OA file, and creates a new one at the create target (.mlt kept). Crash after unlink is a missing header.head (reindex), not a punched live file.

Test plan

  • cargo test -p rbitcoin-store rewrite_to_slots_replaces_file_keeps_keys
  • cargo test -p rbitcoin-store header_head_open_grows_undersized_single_gen
  • cargo test -p rbitcoin-store header_head_rolls
  • Required Actions: fmt, deny, clippy, ast-grep, test, windows, macos, multinode, coverage

Made with Cursor

Open-grow read occupied slots, unlink the OA file, and create a new
one at the target size. A crash mid-grow is a missing header.head
(reindex), not a silent empty live table. .mlt is kept.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit b6ad818 into master Aug 26, 2026
13 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.

1 participant