~ knotless Search/
↑↓ move↵ open⇧↵ all results

zat.dev/zlay

atproto relay in zig · mirror of https://tangled.org/zat.dev/zlay

0
0
44 lines · 2.3 KB Raw History

Write-owner process-crash recovery

All nine SIGKILL/reopen cases passed on disposable Fly infrastructure. The probe uses the actual collection-index owner with up to 16 requests per application, 64 outstanding requests and a 1 ms aggregation window. Sixteen native producer threads submit pages concurrently, with 1, 8 or 64 pairs per request. It is a writer recovery probe; it does not exercise relay networking or a zio reader.

After all 16 requests in a round return successfully, the coordinator writes the acknowledged prefix length. The runner kills the process after 0.1, 1 or 3 seconds. It conservatively uses the preceding acknowledgement line, avoiding a possibly interrupted last stdout write. Recovery may therefore include two rounds beyond that recorded prefix, in arbitrary producer order.

The reopened index scans every forward membership, verifies the reverse lookup, checks that every acknowledged pair exists, rejects unexpected or duplicate pairs, and checks that every unacknowledged page request is either wholly present or wholly absent. The extra observed pairs are permitted durable writes whose acknowledgements were not recorded; they are not data loss.

Pairs/requestKill afterRecorded acknowledged pairsRecovered pairs
10.1 s288312
11 s3,3283,358
13 s10,16010,191
80.1 s2,4322,616
81 s26,11226,352
83 s77,31277,440
640.1 s11,26412,736
641 s119,808121,280
643 s322,560324,032

This verifies these finite process-crash cases, including the real admission and publication path. It is not a power-loss test, exhaustive publication-point fault injection, or proof about Postgres cursor persistence. Graceful close is covered separately by the owner and mixed live/backfill/resync drain-and-reopen tests.

The resource manifest records the recovery executable hash and exact source hashes, completed suite and verified app/volume cleanup. The suite and raw observations are retained. All work ran on the isolated VM; no production relay or upstream traffic was used. The empty load-results CSV is intentional: this suite ran recovery only.