Repository navigation
fix(station): stop unlistable cores from holding tape retention open - #1004
Merged
Merged
Conversation
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.
What & why
A station's tape retention trimmed 0 spans every hour, so
tape_recorder.sqlitenever shrank — neither the 180-day limit nor "do not record emulator trades" deleted anything.Retention waits until every required core has listed its closed trades (the barrier
catchup::listings_complete), so a purge cannot delete tape a not-yet-known trade needs. After 10 minutes it gives up and runs conservatively: every key counts as incomplete andkeep_mapkeeps all tape. The station log showed that fallback on every pass (trim always exactly 10 minutes after the hourly start).Two kinds of core could never list, so the barrier never closed:
venue(code) == None, e.g. Aster):Session::list_tape_catchupreturned before listing;require_listingswas fedconfig_order(every configured server), but only active servers get a session.Changes:
list_tape_catchupsettles a venue-less core's listing at once (catchup::listed_empty) — no row of it can name a venue, so its listing protects nothing.require_listingsgets the ids of existing sessions (connected or not) instead of every configured server.retention: listings incomplete after 10 min, nothing is deleted this pass; cores not listed: [...]).Verified on the production station (dev build): the first pass after the deploy trimmed 4397 spans two minutes after start instead of 0, a following one 18936; the file went from 1.16 GB to 245 MB.
Notable decisions
listed_emptyapplies the completion synchronously: the queuedlistedonly orders completion behind submitted pages, and an empty listing has none.Known limitations
require_listingsto sessions — there is no session harness in the unit tests; the retention-level test covers the barrier itself.Issues
None of the 15 open issues is touched by this change.
How to verify
fmt exit 0, build ok, clippy zero warnings, all 23 test targets ok (moon-core 3309 passed). New tests:
a_venue_less_core_does_not_hold_aged_tape(fails with "maintenance did not settle" without the fix),an_empty_listing_settles_the_barrier_at_once. FireTest not run: no chart/render/window/input change.