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

Call wal_checkpoint during startup/compact for sqlite #109

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

brandond
Copy link
Member

@brandond brandond commented Nov 16, 2021

This should address k3s-io/k3s#3660

As discussed at k3s-io/k3s#4044 (comment), highly active clusters can cause checkpoint starvation due to there always being an active reader. Forcing a checkpoint at the end of compaction should prevent this from occurring, at the cost of blocking writers for a short period. This should not be any worse than the blocking that currently occurs for the compact transaction.

This also adds a WAL truncate at startup, which should shrink the on-disk WAL back down to a reasonable size for users whose files have grown out of control due to the issue described above.

https://sqlite.org/pragma.html#pragma_wal_checkpoint

Signed-off-by: Brad Davidson [email protected]

@brandond brandond requested review from ibuildthecloud and a team November 16, 2021 19:18
@brandond brandond merged commit c1edece into k3s-io:master Nov 16, 2021
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.

3 participants