Skip to content

A log ledger's newest generation is never evicted: the window before a restart survives - #6306

Merged
joelteply merged 1 commit into
canaryfrom
75ba2d17/log-floor
Nov 28, 2026
Merged

joelteply merged 1 commit into
canaryfrom
75ba2d17/log-floor

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card 75ba2d17. The IntelMac 2026-11-28: disk.relief at 06:59:25Z (High, want
58,201,989,605 bytes); at 06:59:55Z, 26 s after the 06:59:29Z boot,
disk.relief.asked had pool disk-logs give 16,777,027 bytes: the core log's .1
and .2, the minutes before the restart. The appender keeps generations as
designed; relief evicted them, asking the logs pool last after the larger
pools protected their files.

RotationLogPool's eviction now never takes .1, the newest generation: the
window a deploy's comparison reads (the plan's rule 3). The floor is the live
file and .1, at most two capped generations per ledger. The snapshot reports
.1 as pinned. The percent-of-disk want itself is relief's, replaced by step 6's
time-to-full law, and is untouched here.

Tests: unbounded eviction gives .2 and .3 and keeps the live file and .1, and
gives nothing when asked again; a stranger file is still neither counted nor
evicted.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…a restart survives

Card 75ba2d17. The IntelMac 2026-11-28: disk.relief at 06:59:25Z (High, want
58,201,989,605 bytes); at 06:59:55Z, 26 s after the 06:59:29Z boot,
disk.relief.asked had pool disk-logs give 16,777,027 bytes: the core log's .1
and .2, the minutes before the restart. The appender keeps generations as
designed; relief evicted them, asking the logs pool last after the larger
pools protected their files.

RotationLogPool's eviction now never takes .1, the newest generation: the
window a deploy's comparison reads (the plan's rule 3). The floor is the live
file and .1, at most two capped generations per ledger. The snapshot reports
.1 as pinned. The percent-of-disk want itself is relief's, replaced by step 6's
time-to-full law, and is untouched here.

Tests: unbounded eviction gives .2 and .3 and keeps the live file and .1, and
gives nothing when asked again; a stranger file is still neither counted nor
evicted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Review of #6306 at exact head b38add3 (submission dc4bf40b): PASS.

Verified, by reading the file at that head (git show b38add3:core/continuum-kernel/src/system_resources/rotation_log_pool.rs):

  • The pool's only deletion is remove_file at :200 inside evict_at_least, and its walk now filters generation > 1, so the
    live file and .1 are never taken. generations_of sorts descending by generation (:163), so the oldest still goes first.
  • snapshot marks .1 pinned (:248), so the inventory says what eviction does.
  • The new floor never pins the pool over budget: the budget is capped_appender::rotation_budget_bytes() =
    MAX_LOG_BYTES * (KEEP + 1) = 8 MiB * 9 = 72 MiB (capped_appender.rs:50, :58, :73), and the floor is at most the
    live file plus .1, 16 MiB. So the broker is not left re-asking a pool whose floor exceeds its budget.
  • Tests: eviction_never_touches_the_live_file_or_the_window_before_it asserts 200 freed of 300 and a second ask
    freeing 0 with .1 present; the stranger test asserts .1 survives. CI at that head: 34 pass, 3 skipping, 0 failing.
    Not run locally: the kernel's tests (CI ran them at this head).

@joelteply
joelteply merged commit ceb2414 into canary Nov 28, 2026
37 checks passed
@joelteply
joelteply deleted the 75ba2d17/log-floor branch November 28, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant