fix: drain legacy logs fully on the first post-migration distill - #119
Open
scode wants to merge 1 commit into
Open
fix: drain legacy logs fully on the first post-migration distill#119scode wants to merge 1 commit into
scode wants to merge 1 commit into
Conversation
scode
force-pushed
the
hookless/8-drain-fix
branch
from
July 7, 2026 05:29
e484fbc to
d0f69f7
Compare
scode
force-pushed
the
hookless/8-drain-fix
branch
from
July 7, 2026 06:18
d0f69f7 to
cc66fd1
Compare
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.
Found by the live E2E battery, not by review: the migration flow promises the first post-migration
leiter distilldrains the legacy logs and removes the directory, but it actually took two runs — scan-time obsolete cleanup only
deletes files below
last_distilledas of scan start, so the log emitted by the run itself always survived to thenext cycle. The remote suite's migration step failed on a real box exactly there.
The fix is a post-commit sweep: after
last_distilledhas provably advanced, delete legacy logs strictly below thenew cutoff, then remove the directory once empty. Post-commit placement keeps the crash posture identical to
scan-time cleanup (a failed run's sweep never executes), and the strict cutoff mirrors the inclusive
>=scan rule sonothing is deleted before a run that emitted it has committed. Review of the fix surfaced one real interaction: a
concurrent distill's sweep can now delete a legacy log another in-flight run had listed but not yet read — that read
becomes warn-and-skip rather than a spurious hard failure, since the vanished file's content is committed by whichever
run swept it.
changelog: include