store: the station read model moves from barrel_docdb to an ETS table #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hygiea/1-stations-ets"
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?
Purpose (work): mcl-stations stops using RocksDB — its directory is served from one ETS table, and the service writes nothing to disk — so the RocksDB images can be deleted once every service is ported (macula-io/macula-ci-images#19, design §2).
DECIDED 2026-11-23 (Raf): "we don't use rocksDB anymore", then "Port them off, then delete (Recommended)".
What changes
station_store(new) owns one ETSsetkeyed by the signer's key id, and does EVERY write. A station'snode_recordandstation_endpointarrive independently and land in one row, so each write is a read-modify-write; one process doing it is what keeps one record type's fields from erasing the other's. The table isprotectedwithread_concurrency, sostation_read_model:fold/2reads it directly, no call.station_read_modelkeeps the pure projections (project_node_record/2,project_station_endpoint/2), the serving helpers andto_wire/1; its three writes are calls into the store, andopen/1anddb/0are gone.is_live/2the readers use. Before, a lapsed row was only skipped at serve time and kept forever.sweep_now/0lets a suite drive one.MCL_DATA_DIRanddata_dir/0go;start/1opens nothing, and the supervisor starts the store before the feeder.barrel_docdb, the rocksdboverridesblock inrebar.configandrocksdb_link_testsare removed. The images become the plain pair on the forge's own registry, by digest:macula-ci-otpbuilds,macula-pq-runtimeruns; lint's job container is the builder with the org's read-only pull account (CI_IMAGE_PULL_USER/CI_IMAGE_PULL_TOKEN, the martha#63 form).architecture/c4_diagrams.py, rendered and checked) lose barrel/rocksdb and gainstation_store. Version 0.7.0, per the file's own convention: the CHANGELOG heading, the app.src vsn andinfo/0move together, as commit82bd80ddid for 0.6.0.Tests: the fixture starts and stops
station_storeinstead of a temp dir; the two barrel-specific cases become the sweep's two verdicts (drops a row with both records lapsed, keeps one with either live); the service suite asserts the store-then-feeder child order and that a feeder restart costs no row, and its image-pin case moves to the plain pair. The corrupt-record case inlist_stations_testsdrivesserved/3directly: nothing that writes the table can lay down a record that does not verify, and the guard stays for depth.Proof on this tip (
e4f31868, OTP 28.4.3 locally):rebar3 compile,rebar3 eunit(128 tests, all passed),rebar3 lint,rebar3 xrefandrebar3 dialyzerall exit 0.Not in this change, on the owner after it lands: drop
/bulk0/mcl-stations:/datafrom beam03's compose and delete/bulk0/mcl-stations(50 GB, nothing to keep) once the new version is healthy. That is Raf's pin signature, through the Supervisor's menu.Refs #1
Refs macula-io/macula-ci-images#19
The forge port (
af56f92)The whole CI moves to the forge (macula-io/martha#601, ci-images#19 step 1a), on macula-realm's landed pattern:
lint.ymlandbuild-push.ymlbecome onetest.yml(guard, check, hand-lock, lock-arrives, advisories); plain-shell checkout, no marketplace action, timeout-minutes on every job that runs steps.ci-images-*.ymlstand-ins in this directory (byte-identical to macula-realm's copies at the shas their headers name): a cross-repository call on the forge needs a public repository on the other side.hand-lockfiles<commit>.<sha256>.rebar.lockon thetested-locksrelease on a push to main,lock-arrivesproves the hand-off on every PR. Until P6 gives this service a signer, this repository publishes no image and a box keeps the digest it already runs.attestis gone: GitHub OIDC keyless has no forge equivalent, and realm left it GitHub-only.ghcr.io,docker/*action,push: trueoruses: actions/in the files we author fails the suite (mutation-checked).Proof: in the forge's own image on msi00 (
macula-ci-otp@sha256:3e202cf7...),rebar3 lint && xref && eunit && dialyzerexit 0 with 129 tests passed -- exactly whattest.yml's check job runs.Before the first push to main: the
tested-lockspre-release must exist on this repository (a lander creates it once, as macula-realm#3 did), orhand-lockgoes red on main.Landed on main by Terra: main 82bd80d..8e5c050a (fast-forward to this PR head). Main push run test.yml 2243: check, guard and the hand-lock job green; named reds only (macula-ci-images#11, #12). Closed by the dispatcher because manual-merge marking is off on this repo (405).
Pull request closed