Files
zeekayandHanzo Dev b417c9289b store: a lost swap waits before it reads again, and a read-modify-write takes 16 rounds
TestReturnsAcrossTwoReplicasAreNeitherLostNorDoubled failed on every CI run with
"invoice ... changed under 8 reads in a row": 72 writers swap one invoice, each
loser re-read at once and met the same crowd again, and with enough CPUs some
writer lost all 8 rounds. Measured locally (CGO, sqlite_math_functions, as
hanzo.yml): 8/20 failures at -cpu 10, 0/20 at -cpu 1. Nothing was lost or
doubled; the refund webhook answered an error instead of landing.

mixin.Rounds yields the rounds and sleeps a random time below 1ms, doubled each
round, held at 64ms, before every re-read. Every read-modify-write (refunds,
disputes, idempotency guards, payment records, auto-recharge, remittances,
seats) uses it. Backoff alone at 8 rounds: 2/100; 16 rounds alone: 0/100; both:
0/300 at -cpu 10.

Co-authored-by: Hanzo Dev <[email protected]>
2026-11-12 13:52:17 -08:00
..
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00
2026-09-23 21:52:16 -07:00