The three rules
Charged at most once. A payment should be charged once, however many times the call is retried. It breaks when a call that already charged looks failed to its caller, after a timeout or an error further on, and the retry charges again. It also breaks when the network delivers the same call twice. No saved write is lost. Every write a client was told was saved should reach storage. It breaks when a part answers “saved” before the write is safe, and then crashes or restarts. A write still on its way when the run ends is not counted. Read your own writes. Once a client is told a write was saved, its own reads should see it. It breaks when a read goes to a copy of the data that has not caught up yet.Check a design
- Mark the part that charges money. Select it, and under Correctness turn on Each finished call charges money. This changes nothing about how the run plays. If you skip this step, the panel asks which part charges the card.
- Open Can you break it? and pick Every payment charged at most once, No saved write is lost or Read your own writes.
- Press Try to break it.
- If it breaks, press Follow request. You get the first request that broke the rule as a timeline, with the bad step tagged Charged again, Lost or Stale.
The usual fixes
These are settings in the inspector’s Correctness and Durability sections.
Each fix has a cost the simulator shows. Reading from the primary takes one of its write slots. Writing to disk first is the safe choice, though this model does not charge the extra time a real disk would take.