Skip to content

fix: prevent write loss during block rotation and harden WAL recovery - #768

Open
zhourrr wants to merge 2 commits into
alibaba:mainfrom
zhourrr:codex/fix-wal-recovery
Open

zhourrr wants to merge 2 commits into
alibaba:mainfrom
zhourrr:codex/fix-wal-recovery

Conversation

@zhourrr

@zhourrr zhourrr commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Fix a crash-recovery data loss window where rotating a full block could delete the WAL containing a newly logged operation before applying it. Rotate the block before appending the next operation.

Harden WAL recovery by:

  • Validating the entire log before replay, including document payloads and predecessor IDs.
  • Recording explicit predecessors for new upserts and supporting legacy upsert recovery.
  • Distinguishing corruption from incomplete crash tails and preserving valid records.
  • Enforcing read-only access and consistent WAL reader/writer state.

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