Skip to content

fix: drain legacy logs fully on the first post-migration distill - #119

Open
scode wants to merge 1 commit into
hookless/7-e2efrom
hookless/8-drain-fix
Open

fix: drain legacy logs fully on the first post-migration distill#119
scode wants to merge 1 commit into
hookless/7-e2efrom
hookless/8-drain-fix

Conversation

@scode

@scode scode commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Found by the live E2E battery, not by review: the migration flow promises the first post-migration leiter distill
drains the legacy logs and removes the directory, but it actually took two runs — scan-time obsolete cleanup only
deletes files below last_distilled as of scan start, so the log emitted by the run itself always survived to the
next cycle. The remote suite's migration step failed on a real box exactly there.

The fix is a post-commit sweep: after last_distilled has provably advanced, delete legacy logs strictly below the
new 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 so
nothing 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

@scode
scode force-pushed the hookless/7-e2e branch from 7759ab8 to aed593e Compare July 7, 2026 05:29
@scode
scode force-pushed the hookless/8-drain-fix branch from e484fbc to d0f69f7 Compare July 7, 2026 05:29
@scode
scode force-pushed the hookless/8-drain-fix branch from d0f69f7 to cc66fd1 Compare July 7, 2026 06:18
@scode
scode force-pushed the hookless/7-e2e branch from aed593e to 3aedb4f Compare July 7, 2026 06:18
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.

1 participant