Skip to content

Fix salt association across WAL boundary.#322

Merged
rhashimoto merged 1 commit into
masterfrom
fix-wal-boundary-bug
Apr 22, 2026
Merged

Fix salt association across WAL boundary.#322
rhashimoto merged 1 commit into
masterfrom
fix-wal-boundary-bug

Conversation

@rhashimoto
Copy link
Copy Markdown
Owner

@rhashimoto rhashimoto commented Apr 22, 2026

Fix #320.

When loading a transaction from the WAL, if the load starts on one WAL file, reads the end record, and moves to the other WAL file, then the wrong file identifier (the waSalt1 property) was set on all the pages on that transaction. This could cause reads from the wrong WAL file which would appear as database corruption errors.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the WriteAhead class in src/examples/WriteAhead.js to adjust the handling of the waSalt1 property within transactions. Specifically, it initializes waSalt1 with a placeholder value, ensures it is correctly assigned from the active header during frame processing and transaction finalization, and updates a code comment for clarity. I have no feedback to provide.

@rhashimoto rhashimoto merged commit bef4178 into master Apr 22, 2026
1 check passed
@rhashimoto rhashimoto deleted the fix-wal-boundary-bug branch April 22, 2026 19:21
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.

Database Disk Image Malformed (WriteAheadVFS, FTS5, GEOPOLY)

2 participants