chadtmiller.com/monolith
An atproto PDS
0
0
harness: pds_log_bytes grows across a write that lets nothing go
Merged Approved
The pull changes the pds_log_bytes check so it no longer fails when a fold or the journal lets bytes go between two reads. spec/OPERATIONS.md now says when the gauge may fall. The canary reads the data directory before the first scrape and after the second. It requires the gauge to grow only across a write during which no file was made, deleted, replaced (new inode) or cut short. Otherwise it writes another record, up to 20 times.
- Strictness: The check does not loosen anything. Any write with no file change must show growth. The planted-fault run in the body shows it still catches a gauge that never counts writes.
- Unmet check: If all 20 tries are excused, the check is counted as not held rather than failed. The spec leaves room for that, and the body names it as a shortcoming.
- Spec and harness: The spec paragraph and the "How it is checked" text match the harness behaviour.
- Server code and changeset: The pull changes no server code and adds no crates. It makes no change a server runner or caller would see, so no
.changeset/file is needed. - Left unchecked: I did not run the gates or either seed.
- Edge case, not blocking: A replaced file that reuses the old inode with a larger size would not register as a change. That would only make the check stricter, and only where a server replaces files in place, so I don't think it needs a fix.
Ejected at 22:43 by the --store run's start-time limit (The --store run's start-time limit fails pulls that don't touch starting), not this pull: every step before it agreed. Queued again.
All checks have passed
4 passed, 1 skipped
4 passed checks
citationsSuccess in 4sdocsSuccess in 16sgatesSuccess in 3srelease-pullSuccess in 16s1 skipped check
releaseSkippedMerged as 5e6c396
Merging this pull closed these issues
The metrics check held
pds_log_bytesto growing across the canary's createRecord, which a fold or the journal letting go of its records between the two reads breaks (the release pull's gates, seeds 31 and 32). The spec now says when the gauge may fall, and the check holds it to growing across a write during which the data directory shows nothing let go.Claude Opus 5.5
What changes
spec/OPERATIONS.md, "Metrics". A paragraph after the table says what
pds_log_bytesdoes across a write: it grows by what each write puts in the logs and falls only as the server lets go of what they held, a log's generations folded into its checkpoint (an account's table,STORE.md, "Bounds"), which a write may start and the server may run in the background at any time, and the journal's records once durable where they are kept (DURABILITY.md). It lets go of nothing but as it makes, deletes, replaces or cuts short a file inPDS_DATA_DIR, and no sooner than that leaves the gauge; so across a write during which no file there was made, deleted, replaced or cut short, it grows. "How it is checked" says so in place of "grown by the record".harness/checks/operations.mjs. The canary reads the data directory (each file's path, inode and size), then the metrics, writes its record, reads the metrics and the directory again; where a file was made, deleted, replaced (another inode) or cut short, it writes another record and tries again, up to 20; the first written with no such change must find the gauge grown, or the run fails. The old check after the firehose and
listReposwaits is gone, andbytesUnderreads the directory through the same walk, which no longer throws on a file deleted while it is read.Why
Fixes The commands run's pds_log_bytes check fails when the log is compacted mid-step
pds_log_bytescounts the logs not yet folded away, their checkpoints and the journal, so it falls whenever a fold or a journal checkpoint lets bytes go, and the old check read it across more than a second of waits for the firehose: the journal alone lets go two quiet seconds after a write. The spec's "grown by the record" was wrong, not the server. Of the ways to hold the gauge to something exact, an equality with the log files' sizes needs the harness to know the server's layout, which the spec leaves to the server, and the files hold room besides their frames; a count of folds in the metrics would be a new server feature. The data directory is what the harness reads already, and any way a server lets log bytes go shows there as a file made, deleted, replaced or cut short, so the check excuses exactly that and nothing else, and is strict on every other write.How it was checked
node compare.mjs --steps 400 --seed 31 --commandsand--seed 32, againstpdsbuilt from this branch: both pass, the first record written with no file changed, the gauge grown by 3805 bytes.fetch_minover every scrape inGauges::of), so it counts what is let go but no write: seed 31 fails,pds_log_bytesafter a createRecord "more than 20947", server 20947. Put back.gatesworkflow's, on this pull.Shortcomings
A server that changes some file in the data directory on every write, but by growing it, would leave this check unmet in all 20 tries: it is then counted as not held (
metrics: pds_log_bytes across a write that let nothing go, an error in the tally), not failed, as the spec does not forbid that._stats'slogBytesbetween two scrapes is unchanged: with no write between them the gauge only falls, which keeps it between.