Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit on WAL commit failure #405

Merged
merged 1 commit into from
Sep 21, 2023
Merged

Exit on WAL commit failure #405

merged 1 commit into from
Sep 21, 2023

Conversation

benbjohnson
Copy link
Collaborator

@benbjohnson benbjohnson commented Sep 20, 2023

Failures during the last commit phase of WAL operation need to exit as we currently don't have a way to communicate to the SQLite client to rollback the transaction. The commit is detected by the release of the WRITE lock, however, SQLite doesn't handle errors from this syscall so an exit is called instead.

We originally used the WAL write syscall to determine the transaction boundary, however, it is not contiguous when pages are rewritten within a single transaction so it make tracking boundaries inconsistent. We also evaluated checking the fsync syscall, however, this is not used if PRAGMA synchronous=normal is enabled by the client. In the long term, we should re-evaluate the use of write(2) to determine transactional boundaries in WAL mode.

@benbjohnson benbjohnson merged commit 4b77ba1 into main Sep 21, 2023
16 checks passed
@benbjohnson benbjohnson deleted the wal-exit branch September 21, 2023 19:59
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