Expand description
The concurrent write workload and result collection for the oracle.
Each writer interleaves three op streams against the replica Dispatcher:
- Contended RMW on a small set of shared keys — read the current record,
append this op’s globally-unique id to the record’s comma-separated set,
and conditionally
putagainst the revision just read. OnConflict, re-read and retry (bounded). This is the arbitration proof: if conditional writes are correct, every committed op-id survives in the final set. - Lifecycle ops (#203) on a small set of
life-*keys — edit, delete, or recreate, chosen by a per-run lifecycle counter (lifecycle_op_for). Each op reads the key, then issues one conditional write against what it read. A lost race is recorded asConflictand not retried. Deletes therefore race edits and recreations across replicas, and afterwards every replica must agree on whether each key is deleted. - Unique-key writes — disjoint keys written once, later read back to prove
no acked write is lost across replica kills. The first
unique_deletes_per_writerof each writer’s acked keys are then deleted and must still read as tombstones at the end (no resurrection under churn).
After all writers finish, run reads the contended and unique keys through
the dispatcher. The per-replica lifecycle read, collect_lifecycle, is a
separate call because it must reach every replica directly. The caller runs
it once all replicas are live again.
Structs§
- Workload
Config - Workload shape. The bounded gate and the deep soak both use this; they differ only in the magnitudes and (for the deep soak) running against a duration.
Functions§
- collect_
lifecycle - Read every lifecycle key from every replica directly (raw and consumer).
Call only after the writers have stopped and all replicas are live: a final
read retries up to 3 attempts, 200 ms apart, on errors only, so a connection
pooled to a just-restarted replica doesn’t fail the soak on its own; a
replica that stays unreadable is still reported (
FinalReadFailed). - lifecycle_
key_ for - The key a lifecycle id targets. Divides by 4 (the op cycle length) before taking the modulus so the key and the op are decorrelated: every key sees every op kind.
- lifecycle_
op_ for - The op a lifecycle id performs: a quarter deletes, a quarter recreations, and half edits (so deletes race live writes, which is what makes them conflict).
- raw_
state - Classify one raw read for the oracle. Revisions render as
"<counter>:<hash>". - run
- Run the workload to completion and collect stats for the oracle.
dispatcherfans ops across the live replicas; chaos (replica kills) is driven separately by the caller while this runs.lifecycleis left empty: fill it withcollect_lifecycleonce every replica is live.