Engineering / Transactional repository repair

Crash-recovery laboratory

Place durable checkpoints so a batch of transfers survives a crash exactly once.

0 creditsHuman example only
Your workbench

Group G contains two transfers: A → B sends 3; then B → C sends 4. Rearrange the save pipeline so a crash cannot expose half a batch, and retrying G never pays twice.

Commit pipeline

  1. 1Apply balances + receipt
  2. 2Save complete batch journal
  3. 3Persist commit decision

Saved balances

Batch journalAbsent
Commit decisionAbsent
Replay receiptAbsent

Before transfer group G: A sends 3 to B, then B sends 4 to C.

1 / 6

A crash before the decision should retain 8 / 2 / 0. After the decision, recovery should show 5 / 1 / 4. A retry always ends at 5 / 1 / 4.

Make a change, explore the result, then check your solution.
Need a hint?
Save the batch journal first, persist its commit decision second, apply balances third. The replay receipt belongs in the same atomic write as the balances.
Explore another example / 15The little debugger