~ 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/request | Kill after | Recorded acknowledged pairs | Recovered pairs |
|---|---:|---:|---:|
| 1 | 0.1 s | 288 | 312 |
| 1 | 1 s | 3,328 | 3,358 |
| 1 | 3 s | 10,160 | 10,191 |
| 8 | 0.1 s | 2,432 | 2,616 |
| 8 | 1 s | 26,112 | 26,352 |
| 8 | 3 s | 77,312 | 77,440 |
| 64 | 0.1 s | 11,264 | 12,736 |
| 64 | 1 s | 119,808 | 121,280 |
| 64 | 3 s | 322,560 | 324,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](zkv-load/fly-group-recovery/fly-resources.json) records
the recovery executable hash and exact source hashes, completed suite and
verified app/volume cleanup. The
[suite](zkv-load/fly-group-recovery/suite.sh) and
[raw observations](zkv-load/fly-group-recovery/recovery.csv) 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.