Repository navigation
feat(wal): collect obsolete application snapshot files - #426
Merged
beinan merged 3 commits intoOct 21, 2026
Merged
Conversation
43 of 51 tasks
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.
Summary
Obsolete and abandoned application snapshot files remain on disk after checkpoint replacement or an interrupted transfer. Add a resumable, bounded directory scan that removes unreferenced snapshot files while preserving installed recovery images and captured readers across all groups sharing a node.
Image readers and collection cursors retain the engine's exclusive directory lock, so callers must release them before reopening the node. Ordinary Raft appends can continue during collection. This API does not reclaim Raft-engine segments or Lance objects, schedule maintenance, or enforce a disk quota.
The coverage run also exposed a directory-lock failure in a parallel snapshot reopen test. Isolate independent fork/reopen cases in that test binary and add a deterministic regression showing that an unrelated pre-exec child retains the native directory lock until exec. The original unmodified suite passed 128 local repetitions, so the regression demonstrates the mechanism without claiming to have reproduced the original CI failure. Concurrency and recovery assertions inside each original case remain intact.
Refs #378.
Testing
The following checks passed on the combined current-main tree:
The unchanged WAL source also passed 64 repetitions of the four-test snapshot integration suite before combining with the latest main changes.