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

Force truncation checkpoint if WAL becomes runaway #473

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

hifi
Copy link
Collaborator

@hifi hifi commented Apr 26, 2023

A failsafe to force WAL truncation if somehow between normal checkpoints the WAL grows to extreme sizes. Default is around 200 megabytes with 4k page size.

This helps if there's sudden write pressure that doesn't allow passive or restart checkpoints to happen for a while. When Litestream is able to checkpoint again it will issue a TRUNCATE one which will roll in the WAL.

@hifi
Copy link
Collaborator Author

hifi commented Oct 14, 2023

@benbjohnson Also interested if there's something more that could/should be done? Preventing the WAL from growing indefinitely has been important in high write pressure scenarios.

@benbjohnson
Copy link
Owner

@hifi If you can rebase this PR then I'll merge it as well.

A failsafe to force WAL truncation if somehow between normal
checkpoints the WAL grows to extreme sizes.

Default is around 200 megabytes with a 4k page size.
@hifi hifi force-pushed the for-upstream/truncate-wal branch from 990ee96 to 2814223 Compare October 17, 2023 05:02
@hifi
Copy link
Collaborator Author

hifi commented Oct 17, 2023

Done 👍

@benbjohnson benbjohnson merged commit fe9ab5c into benbjohnson:main Oct 20, 2023
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.

2 participants