Repository navigation
Conversation
pfi79
marked this pull request as draft
October 23, 2026 12:41
pfi79
force-pushed
the
truncate-wal-on-sync
branch
from
October 23, 2026 13:02
1e6d8cf to
6329c7f
Compare
The WAL only freed space at a truncation point, which only a pre-prepare carried. A node that never proposed never deleted a file: files rotated by size, truncateIndex stayed zero, and restarts accumulated anchor-only files. PersistedState.Save now derives the truncation flag from whether a proposal is in flight rather than from the message type, so NewView after sync or view change and ViewChange with nothing in flight also truncate. A commit never does, keeping a pre-prepare and its commit together. Open also drops trailing anchor-only files, so restarts stop adding files. Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
pfi79
force-pushed
the
truncate-wal-on-sync
branch
from
October 23, 2026 13:04
6329c7f to
aa13246
Compare
pfi79
marked this pull request as ready for review
October 23, 2026 13:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Watching the stands, I found that some nodes are accumulating wal files, while they are quite working and efficient. The height of the blocks is normal. I think it's just that there are no signals for such nodes to trim the wal files. Below is my suggestion to change the situation:
The WAL only freed space at a truncation point, which only a pre-prepare carried. A node that never proposed never deleted a file: files rotated by size, truncateIndex stayed zero, and restarts accumulated anchor-only files.
PersistedState.Save now derives the truncation flag from whether a proposal is in flight rather than from the message type, so NewView after sync or view change and ViewChange with nothing in flight also truncate. A commit never does, keeping a pre-prepare and its commit together. Open also drops trailing anchor-only files, so restarts stop adding files.