chadtmiller.com/monolith
An atproto PDS
Operations and the log store: logs, health, metrics, traces, perf gate; bounded disk and start time
MergedThis pull adds operations (JSON logs, health, metrics, traces, a perf gate, shutdown) and a bounded log store. It also stops syncing uploadBlob and syncs a blob in the group commit that first references it.
What I checked and found sound:
- The
spec/DURABILITY.mdandspec/BLOBS.mdchanges match the blob-sync code inblobs.rs(sync_before,recover,place), and its power-cut test covers the case. - The only new dependency is
flate2, plus tokio'ssignalfeature. Neither is an atproto or MCP crate. - The harness changes I read only add recording of the harness's own requests, a taken-down-blob model, and renewal of confidential sessions near expiry. None loosens a check.
perf.mjsstates its 1.5× p99 and 0.8× throughput thresholds. harness/conformance.yamlis untouched.
One change to make: the README says the code gates "switch on in a following change". That is a plan, and AGENTS.md and review.md ask the README to say what is built, with no plans. State that just code is not among the gates, and drop when that changes. The gates.yml and Justfile comments say the same and can be reworded too.
Not read. I did not read these files, and so cannot vouch for the claims about no secrets in logs, bounded metric labels, crash safety of compaction, or the SSRF path:
- Server:
checkpoint.rs,compact.rs,events.rs,log.rs,ops.rs,ops/*,store.rs,lib.rsand about 15 smaller server files. - Crates:
pds-storeandpds-repo. - Harness:
operations.mjs,store.mjs,logging.mjs,observe.mjs,otlp.mjs,prometheus.mjs,processes.mjsand a few others. - Specs:
OPERATIONS.md,STORE.md,SYNC.md,LIMITS.md,FEDERATION.mdandPDS.md.
Those rest on the pull's own checks.
README.mdline 135Outdated
several runs at once (`harness/gates.mjs`; `GATES_JOBS` sets how many), and | |
then the performance step alone. The `gates` workflow runs them on every | |
pull into `main`. The code gates (Checks) are not among them yet: they | |
switch on in a following change, once the source passes them. |
This describes a plan ("switch on in a following change"). The README says what is built: say the code gates are not among the gates run, without saying when that changes.
README.mdline 162Outdated
| |
Besides the harness and the tests, the source itself is to be held to | |
these, the code gates (`just code`), which switch on as gates in a | |
following change: |
Same here: "which switch on as gates in a following change" is a plan. Say that just code runs these and they are not among the gates.
Fixed in 370ae13. The README's two passages, the Justfile's comments and the gates workflow's header now say what is: the code gates are not among the gates, and just code runs them on their own. No plan or 'following change' remains.
The one change I asked for is done. The README, the Justfile and the gates.yml comment no longer promise that the code gates switch on later. They now say plainly that just code runs them and that they are not among the gates. The diff since my last review touches only those wording changes, so the rest of what I read earlier stands. As before, I did not read the log-store and operations server files, so I can't vouch for the claims about secrets in logs, bounded metric labels or crash safety of compaction. Those rest on the pull's own checks.
The queue ejected this when the harness step reached the runner's 30-minute limit on one step: every run that finished had passed (all the crash, firehose, store, spaces, plain, limits, invites, commands and lifecycle runs before the kill). With --store and --lifecycle added, the runs no longer fit one step. Fixed in 6486de9: the five 1000-step crash runs are a suite of their own (crash), and the workflow runs compare, crash and commands as three steps. From this run's timings, at two runs at a time each step takes about 7 to 16 minutes. No run was dropped or shortened.
Since my approval at 370ae13, the pull only moves the crash runs (seeds 21–22, and 21–23 with the firehose) out of the compare gate into a new crash suite in harness/gates.mjs. It adds a matching crash step to gates.yml and changes the Justfile to run compare crash commands. The same runs stay in the gates. The workflow still runs compare, crash, commands and perf, with nothing dropped or loosened, and the comments say what is built. I read only this diff. As before, I did not read the log-store and operations server files, so those claims rest on the pull's own checks.
Operations and the log store, together to save a merge-queue cycle.
Operations: the server can be run and watched (
OPERATIONS.md, new).Logs: JSON lines on stdout.
time,level,msg; per requestmethod(a bounded route label, never a path),status,ms,did,trace_id.PDS_LOG_LEVEL; the eventsstart,recovered,request,plc failure,trace export failedandshutdown.Health:
/xrpc/_health, as the reference answers it (probed).Metrics: Prometheus
/metricson127.0.0.1:PDS_METRICS_PORT, with ten families and bounded labels. The harness checks the counters against the requests it sent.Traces: OTLP/HTTP protobuf, with the standard
OTEL_*variables and incomingtraceparenthonoured.fsyncspan on commits and CLIENT spans for every outbound call.Shutdown: SIGTERM or SIGINT drains for up to 10 s, then exits 0.
One outbound path for every call to another service: the SSRF guard, slot pools and body caps, the CLIENT span, the metrics, and a failure line.
Blob durability:
uploadBlobanswers without a sync, and survives a kill as before;DURABILITY.md"Blobs");uploadBlobwent from 96/s to over 400/s, about 1.5× the reference.Perf step (
harness/perf.mjs, in the gates): a fixed workload on both sides. The server's p99 must be at most 1.5× the reference's, and its throughput at least 0.8×, best of three rounds.The log store: disk use and start time follow current state, not history (
STORE.md, new; storage-agnostic like every page).PDS_REPO_BACKFILL_LIMIT_MS,#info OutdatedCursor, and seqs never reused.getBlocksanswers400for them, as the reference does.store.rs' doc comment.Code gates:
deny.toml,just codeand the README's Checks section are here. Thecodesuite (fmt, clippy, cargo-deny,forbid(unsafe_code)) switches on in the cleanup pull that follows, which fixes the code it flags.Checked: plain seeds 1–2,
--commands31, crash seed 21 with--firehose,--limits,--lifecycle,--invites,--store, the spaces run and the perf step, each run passing its end-of-run log, metrics and trace checks; andcargo test --workspace. The merge queue runs the full gates.🤖 Generated with Claude Code