Cache retention drops each minute's new entries once its page cursor reaches the newest entry #87
Closed
opened 2026-11-16 13:58:44 +00:00 by xemmerling
·
0 comments
No Branch/Tag specified
main
sched/probe-floor
sim/session-home
speed/session-home-main
overbook-reland
overbook-demand
speed/sources
speed/end-cost
speed/session-home
speed/storage
speed/delivery
overbook
roots-hotfix
privileged-vm
image-store
sandbox-bump
found-by-package
mac-node
dev/schema-step-order
t-join-release
t-work-booking
t-ahead-deadlock-wip
t-hotfix-9ae
t-width-work
t-id-token-renew
t-claim-unkept
t-resume-live
t-run-record
t-all-lockfiles
t-relay-offset
t-blame-event
t-freer-links
t-load-tests
t-jobserver2
t-starved-timeout
t-client-pack
t-offline-config
t-test-plan
t-told-resume2
t-jobserver
t-told-resume
t-outbound2
t-crash-open-bench
t-told-once
guest-never-below-given
admit-page-cache-active
pooled-admission
driver-give-back
no-sizes
one-driver-per-check
archive/vm-root-share
archive/build-out-kept
archive/cargo-perf
archive/virtiofs-readdir-alloc
archive/vm-outputs-stream
archive/stable-verify-priority
archive/agents-1
archive/stack-parallel
archive/cpu-admission
archive/narrow-from-every-log
archive/old-t
archive/worker-store-gc
archive/failing-builds-kept
archive/vm-cargo-home
archive/lifecycle
archive/bench-own-cores
archive/place-test-binaries-nocopy
archive/vm-net-upload-stall
archive/booking-current-use
archive/archive-dep-out-dirs
archive/any-arch-shards
archive/prepare-stall-progress-ns20
archive/s2
archive/next-set-20
archive/store-full-waits
archive/fetch-caps-by-node
archive/vm-step-phases
archive/arm-only-for-arm
archive/deploy-all-workers
archive/lifecycle-staging
archive/lifecycle-1-wire
archive/fast-gate
archive/cargo-key-narrow
archive/log-leads-followup
archive/gate-limit
archive/prepare-stall-vm-bytes
archive/lifecycle-2-ends
archive/cache-hits-bind
archive/failing-reused
archive/oci-archive-direct
archive/prepare-stall-progress
archive/test-quarantine
archive/crash-safe-on-18
archive/build-script-etxtbsy
archive/old-release
archive/next-set-19c
archive/wait-reasons
archive/cache-put-best-effort
archive/hang-not-t-time
archive/shard-test-results
archive/vm-carry-on-17
archive/check-test-filter
archive/artifact-path-beneath
archive/stall-room-xfs
archive/build-dir-no-recopy
archive/cache-hits-link
archive/outputs-no-follow-on-copy
archive/outputs-no-follow
archive/next-set-19
archive/hang-detect
archive/stable-verify-stable-plan
archive/freer-target-only
archive/lease-pricing-narrow
archive/vm-outputs-once
archive/queue-place-starved
archive/publish-reads
archive/disk-warning-scratch
archive/outputs-no-copy
archive/wd-probe-3min
archive/watchdog-on-d65
archive/log-leads-with-excerpt
archive/queue-place
archive/prep-watchdog-progress
archive/cache-put-stack-room
archive/cache-put-stack
archive/place-by-pace
archive/nested-sync-helper
archive/next-set-18y
archive/archive-bins-by-env-19
archive/next-set-18
archive/disk-want-held
archive/young-booking-back
archive/flaky-tests-1027b
archive/next-set-17
archive/prep-start-at-close
archive/unpack-error-on-17
archive/server-memory-high
archive/vm-start-held
archive/vm-carry-on-14
archive/space-trim-registry-room
archive/file-cache-ns16
archive/unpack-error-final
archive/crash-safe-worker
archive/server-space-trim
archive/status-big-runs
archive/nested-tmp-volatile
archive/publish-refresh
archive/gc-cache-quiet-reads
archive/next-set-16
archive/vm14-proof
archive/csw-node-kill
archive/unpack-link
archive/vm-tests-15
archive/seccomp-allow-field
archive/flaky-tests-1027-ns15
archive/shard-fail-fast
archive/server-node-check
archive/live-log-restart
archive/unpack-no-orphans
archive/flaky-tests-1027
archive/fetch-share-images
archive/fetch-images-red4
archive/forget-cached
archive/put-file-once-ns15
archive/recheck-rank-15
archive/fetch-images-red3
archive/unpack-no-orphans-red2
archive/fetch-io-pass-followups
archive/sandbox-no-fallback-ns15
archive/unpack-no-orphans-red
archive/archive-bins-by-env-ns15
archive/ns15-proof
archive/next-set-15
archive/archive-bins-by-env
archive/vm-guest-panic-15
archive/sandbox-no-fallback
archive/recheck-rank
archive/placement-ahead-bound
archive/carry-keeps-listing
archive/registry-parallel-pull
archive/sandbox-tests-15
archive/attempt-log-live-15
archive/follow-progress-16
archive/follow-progress-15
archive/ns15-archive-base
archive/fetch-io-max-on-13
archive/fetch-images-red2
archive/transient-build-fail-15
archive/test-ended-early-15
archive/archive-keep-cleanup
archive/main-merge-14
archive/sandbox-clone3-fallback
archive/vm-carry-on-13
archive/fetch-io-sweep-15
archive/vm-root-disk-fixes
archive/vm-guest-panic
archive/follow-progress-14
archive/archive-keep-on-demand
archive/vm-exit-unseen
archive/file-cache-share
archive/bwrap-root-userns
archive/transient-build-fail
archive/fetch-io-max
archive/file-cache-guard-11
archive/fetch-io-sweep
archive/archive-build-dir-skip
archive/next-set-14
archive/wrapper-one-read
archive/archive-tmp-links
archive/attempt-log-live
archive/fetch-share-and-order
archive/vm-hang-io-wait
archive/vm-carry-fixes
archive/image-cancel
archive/test-ended-early
archive/sim-on-train3-bundle
archive/hits-layer-wip
archive/t-old-putfile
archive/archive-links
archive/stall-on-13
archive/carried-prep-completes
archive/put-file-once
archive/preview-14
archive/follow-progress
archive/gc-reads-dont-protect
archive/admission-replay-people
archive/people-pickup
archive/gc-pass-visible
archive/hits-layer
archive/own-build-priced
archive/compact-stamps-followup
archive/prepare-timing
archive/sim-on-train3
archive/next-set-13
archive/next-set-12b
archive/sim-on-next-set-12
archive/deploy-doc-no-kill
archive/next-set-12
archive/attempt-logs-real
archive/sim-tests-green
archive/shard-label-index
archive/young-booking
archive/next-set-11
archive/data-dir-config-env
archive/vm-sync-not-host-store
archive/attempt-logs
archive/wrapper-ro
archive/tests-wait-on-events
archive/blame-git-optional-needs
archive/job-file-headroom-impl
archive/next-set-10
archive/blame-verdict-fresh-parent
archive/compact-touched-stamps
archive/interactive-incremental-off
archive/follow-lost-lines-counted
archive/evict-test
archive/next-set-trial
archive/keys-cover-output-bytes
archive/file-cache-guard
archive/blame-after-parent
archive/test-filter-matching-nothing-fails
archive/s1-on-d96
archive/draining-node-queues
archive/tprev-checks-prod-next
archive/s1-dead
archive/follow-live-run
archive/guard-stopped-setup-text
archive/io-error-cause
archive/source-layer-whole
archive/clippy-groups
archive/worker-silence-grace
archive/price-touched
archive/prod-next
archive/batch1
archive/s1-on-prod-next
archive/vmcache/sandbox-copyup-pin
archive/s1-xfs-store
archive/warm-script-builds
archive/vmcache/setup-tag-digest
archive/vmcache/setup-should-fixes
archive/vmcache/setup-any-arch
archive/guard-livelock
archive/host-budget
archive/wire-format-test
archive/admission-replay
archive/switch-safe
archive/stall-window
archive/upgrade-carries-preparing
archive/static-init
archive/switch-proof-b
archive/carry-tokens
archive/seals-together
archive/switch-safe-storage
archive/switch-safe-worker
archive/batch-b-prev
archive/vmcache/batch-b
archive/carry-vm-helpers
archive/small-llvm-args-failed-log
archive/batch-a
archive/stall-hotfix
archive/prev-pacing
archive/u-try-wip
archive/u-try
archive/u-try-wip2
archive/flatten-verify
archive/poll-free
archive/flatten-tiers
archive/hotfix-cross
archive/pool-stall
archive/disk-pacing
archive/u-builds-from-graph
archive/mac-idle
archive/ship-direct
archive/vmcache/shards
archive/soft-margin
archive/behind-no-target
archive/filtered-binaries
archive/vmcache/setup-layers
archive/direct-off-prev
archive/probe-budget
archive/vm-helper-exit
archive/jobs-soft-bound
archive/vmcache/vm-disks
archive/vmcache/failure-outputs
archive/narrowed-not-verdict
archive/scratch-direct-off
archive/handover-holds
archive/memory-lines
archive/drain-destroys
archive/pool-size
archive/drain-own-frees
archive/test-schema-drop
archive/deploy-disk
archive/deploy-disk-lines
archive/clone-aware-freeing
archive/absolute-headroom
archive/zfs-pool-size
archive/u-int5
archive/u-load
archive/u-warn
archive/u-steer
archive/revert-stall-once
archive/guard-headroom
archive/u-int3
archive/u-readsets
archive/u-hermetic
archive/mem-virtio
archive/u-buildjobs
archive/u-waits
archive/u-three
archive/u-zfs-stall
archive/u-config
archive/u-lean
archive/u-e2e
archive/u-integrate2
archive/u-jobenv
archive/u-cache-blobs
archive/u-observe2
archive/u-sched-nospread
archive/u-node-bound
archive/u-sched-oom
archive/u-review-store
archive/u-observe
archive/u-review-engine
archive/u-review-srv
archive/u-review-node
archive/u-review-sched
archive/preempt-measured
archive/u-integrate
archive/u-eng
archive/lock-off-runtime
archive/u-vm
archive/u-gone
archive/u-offline
archive/ready-starve
archive/u-notices
archive/heads-never-superseded
archive/u-learn
archive/int
archive/u-graph
archive/u-umount
archive/supersede-followed
archive/preparing-booking
archive/u-xdev
archive/u-env
archive/u-poll
archive/u-wrap
archive/u-room
archive/u-wrap-try
archive/u-fixed
archive/unstall
archive/u-fix3
archive/u-cwd
archive/resume-supersedes
archive/server-heap
archive/u-harness
archive/u-macos
archive/u-node
archive/u-eng2
archive/u-leader
archive/u-cutover
archive/u-cache
archive/u-sched
archive/u-engine
archive/chore/agpl-license
archive/note-x86-disk-room
archive/pass-cost
archive/prod-defects
archive/clippy-false-greens
archive/t-pace-variance-prototype
archive/outputs-reattach
archive/fix-retry-needs
archive/no-supersede-uncached
archive/fix/promoted-view-mtime
archive/rb-merge
archive/ft-sched
archive/ft-node
archive/ft-engine
archive/fx-sim
archive/fx2-mem
archive/fx2-store
archive/fx2-ci
archive/fx-work
archive/fx-ci
archive/fx-sched
archive/fx-req
archive/fx-store
archive/fx-cache
archive/rb-storage
archive/rb-scheduling
archive/rb-sweep
archive/rb-tracking
archive/rb-workers
archive/rb-client
archive/rb-profiles
archive/rebuild
archive/batch-deploy
archive/fix-roll
archive/work
archive/fix-busy
archive/fix-perf
archive/fix-suite
archive/fix-spread
archive/fix-sig
archive/fix-wait
archive/fix-init
archive/sizing
archive/fix-drift
archive/delivery
archive/fix-snap
archive/fix-own
archive/fix-rollout
archive/fix-hang
archive/fix-tree
archive/images
archive/fill
archive/sched-gate-preparing-after
archive/takeover-sim
archive/image-d244b22
archive/image-ce8a09e
archive/image-c9ff4f7
archive/image-489bec9
archive/image-7e07ffb
archive/image-583ea93
archive/image-8e1cd2c
archive/image-fbf0a9c
archive/image-6924e11
archive/image-29cabc3
archive/image-97ebb0e
archive/image-d0e23ac
archive/image-319fce9
archive/image-4f689e1
archive/image-feacbcd
archive/image-d5d9446
archive/image-6b86940
archive/fix/dedup-priority-promotion
archive/image-a5b0fe3
archive/image-462afb1
archive/image-f39d42c
archive/image-6e71fb4
archive/image-0c62329
archive/resources
archive/image-112b6a6
archive/image-8b06530
archive/image-5ae7cd8
archive/fmt-fix-in-t-toml
archive/image-arm64
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
tilo/t#87
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Production
b5c5b140, read-only readings of 13:30 to 13:57Z 11-16. Since about 09:45Z today the cache's retention pass drops, every minute, exactly the entries stored in the minute before, unless something used them meanwhile. A head cannot find what the head before it compiled.What the pass does.
read_page(src/jobs/cache/retention.rs) readsWHERE seq > $after ORDER BY seq LIMIT $sizeand starts a new round only when a page comes back empty. With puts arriving every minute a page after the newest entry is never empty, so once the cursor has reached the newest entry it stays there: each pass reads only what was put since the last one. Earlier drops have drained the pool, so the pool is those new entries alone; their bytes do not cover the excess, anddrop_forlets every candidate go. The pass's own lines say it,readequalsdroppedin every one of the 62 passes between 12:43Z and 13:47Z:Sums over the 62 passes: read 39,997, dropped 43,858, freed 552 GB, mean short 125 GB. The spec's sentence it breaks is the module's own: "every entry is looked at once in each round of pages", and "worth alone decides".
What stands in
entries, by the hour stored (13:56Z):New puts were 12,545 to 33,511 an hour in those hours (Prometheus,
t_cache_puts_total{stored="new"});t_cache_entries_dropped_total{why="trimmed"}was 15,944 to 28,899. So from 10:00Z on about nine in ten new entries are gone within a minute, and the only survivors are those hit before the next pass (drop_candidatesspares what was used since it was read). The same shape, hours with no never-used entry left, shows on 11-15 21:00 to 23:59Z, 11-15 01:00 to 05:59Z and 11-14 22:00Z: each time until a restart put the cursor back at the start (23:46Z 11-15; today's last was 07:56Z, and the round reached the newest entry between 09:15 and 09:45Z).How it showed. Four head runs in a row (jobs j587-14864, -15404, -16798, -17264) each compiled and stored the same 65 units of tilo's wasm page bundle (
min the jobs' own.t-cache-counts; 1,380 hits, 20 not stored). Between two of those heads (tilo ba938bf3b08 and 0508acbb34) four files changed, none in those crates.entriesholds no wasm entry oftilo-actionsat optimisation 1 stored after 09:45:07Z. That build is 18 of the 33 minutes oftest/tilo-session-clientin each head (#74). It is how I found this, not its measure: 38 of 45 heads in the last 16 hours changed a crate that build reads, and that job was as long in the hours when entries stood. What this fault costs is wider: every unit whose key changed since the cursor stuck is compiled again by each head after, in every family, because no head's entry of it stands.What I am doing. This restores the module's stated rule, so I take it as a fix, not a design change: a round ends when a page reaches the newest entry (a page shorter than asked), and the next pass starts again at the first entry; the pool then holds the worst of every page, as written, and an entry just stored (idle 60 s, no hits yet, the best worth there is) goes last. A test with entries arriving before every pass. I am commissioning it now on top of main's head and will land it through the usual check set. If you see the rule differently, or have this in work, say so here and I stop.
Not covered by this: the store stays 107 to 148 GB short of 15% free through all of it, since dropping a minute's puts frees about what the minute added (the readings of 11-13). Whether the same build's keys also differ from job to job when entries do stand (five
tilo-actionsentries of 01:31 to 03:03Z sharekey0andreads_idand differ inkey1) is a separate reading I have not finished.14:20Z: the fix is on main as
8fb821de(on top of57ef25c6).read_pagehands back the size its statement asked for and a page with fewer rows ends the round (Retention::end_round);Paceis unchanged. New testa_round_of_pages_ends_at_the_newest_entry_and_the_entries_just_stored_stand(2.8 s on testing); inentries_growing_past_the_stores_room_lose_each_passs_growththe assertionr.read <= growth.max(1)becamer.read == 600 + growth, since it held only while the cursor stayed at the newest entry. Check set on testing: 15 of 15 on the second run; the first failed on the 50-head range test alone (#88).Two things the developer saw and did not touch, yours to weigh:
Retention::plannedlives in memory only, so the first pass after a restart counts nothing as pending and may drop again what was dropped and not yet collected; and the pass that ends a round still holds that page's just-stored entries in its pool, which go only if the excess exceeds every older candidate left.A restart puts the cursor at the start whatever the build, so the fix shows on production only once a round has passed the newest entry, about an hour and a half after the promote: pass lines with
readfar abovedropped, and never-used entries of the last hours standing.15:03Z: on production. I promoted main's head
8fb821deat 15:02:34Z; it carries your57ef25c6(node protocol 75,job_history.launched_ms), which had been on testing since 09:24Z and not on production. Before it: both CIs green on8fb821de; the protocol step proven on testing with jobs running, both ways (95b08710took over 14 of 14 at 14:29Z,8fb821de13 of 13 at 14:36Z, none unattachable, nomissing field). On production the worker (same pod) fetched the build at 15:03:12Z and saidre-attached to the jobs on disk jobs=42, nothing reaped; the server leads epoch 589.The first retention pass of the new server, 15:04:25Z:
short=103619926425 pending=0 read=20000 dropped=8516 freed=103729571429. That is theplanned-in-memory point above seen live: before the restartpendingstood at 50 to 100 GB of the shortfall, and the first pass after it dropped the whole shortfall again from the oldest page.Whether the fix holds on production can be read from about 16:35Z, when a round has passed the newest entry. I will add the pass lines and the standing entries by hour then.
15:50Z: the round ended at the newest entry and started again, on production. The scan read a full page every minute since the restart; at 15:49:08Z it reached the newest entry and the next pass began at the first:
On the build before, the passes after a short page read only the minute's new entries and dropped every one. The shortfall is down from 104 GB at the restart to 16 to 17 GB. The entries standing by the hour stored follow once a few hours have passed.
What it gave the page-bundle build while entries stood (after the restart, cursor at the start): two jobs found 1,431 and 1,425 of their units and compiled 14 and 20, against 1,380 found and 65 compiled in the four jobs before; the build took 647 s instead of 1,113 s.
16:05Z: an hour on, the entries stand. Since the restart the server logged 59 passes; every one read a full page of 20,000 but the one that reached the newest entry (3,768); in none that dropped anything did
readequaldropped. Entries standing inentriesby the hour stored:New puts in the hour from 15:00Z were 14,698 (
t_cache_puts_total{stored="new"}), so about nineteen in twenty of that hour's entries still stand an hour later, most of them not yet used; the hours 10 to 14, under the build before, kept only what had been hit within its minute. Trimmed in the same hour: 40,593, taken from full pages by worth. I will read it once more after the second round has ended.16:35Z: two rounds on. The server logged 87 passes since the restart; the second round reached the newest entry at 16:33Z (a page of 13,301) and the pass after it read 20,000 from the first entry again; in no pass that dropped anything did
readequaldropped.So what goes now is what the rule names: the hour-15 entries lost 656 in half an hour while 1,800 more of them were used, and the never-used entries of 08:00Z, idle for eight hours, lost 15,669. New puts in the half hour to 16:30Z were 5,742, trimmed 16,084; the shortfall stands between 10 and 24 GB.
17:35Z: three rounds on, closing. (A correction to the two readings above: I had written "passes that dropped something" for what is every pass the server logged, 59 and 87; a pass that drops nothing is logged too. Corrected in place.) The server logged 145 passes since the restart; the scan reached the newest entry three times (15:49Z, 16:33Z, about 17:15Z, pages of 3,768, 13,301 and 5,803) and each time the next pass read 20,000 from the first entry; in no pass that dropped anything did
readequaldropped. Since 17:20Z the store is within its room (short=0 pending=0) and the passes drop nothing.The entries of the first hour after the fix stand unchanged two and a half hours later, ten thousand of them not yet used; what the store's room took meanwhile were the morning's (hour 09: 10,395 to 1,705). That is the rule the module states. Closing; the two points under 14:20Z (
plannedkept in memory only, and the pool at a round's end) stay yours to weigh, and I open nothing for them unasked.