In a fictional catalog import, 40 of 80 records commit before the worker stops. Someone opens the catalog while it’s down, updates the description on one of the records, and approves the edit. The worker restarts and gets the same file. Which description should the customer see?
The demo had already proved something useful. The team could load a file, interpret its rows, and navigate the catalog afterward. I’ve defined import and catalog lifecycle behavior for a prototype. The moment I want to make that behavior dependable, I have to say what retry means for each record and what happens to work someone did while the first attempt was interrupted.
Thesis: Treat replay as part of the behavior of an import, including what happens to edits made between attempts.
Why now: A successful first run says very little about which writes the next run may repeat or overwrite.
Who should care: Teams about to put real orders and catalog data behind a working demo.
Bottom line: Test what survives a partial failure before making the importer responsible for production data.
Give the record and the operation separate identities
A row number is useful for finding an error in the input file. Put the same records in a new order and it stops being a useful product key. I’d require a stable source identity, scoped to the source that issued it. If the importer can’t map it to a product without guessing, I’d keep the row in a review queue with its evidence and the reason it was held.
I’d also record which input operation has already applied. A retry may use the same batch or operation identifier with the same content. A new source revision needs a new operation identity. If the same identifier arrives with different content, I’d reject the inconsistency and ask for review rather than guessing whether it’s a correction. AWS’s treatment of retry-safe APIs gives a similar role to caller-provided identifiers and discusses what happens when the same identifier comes back with a different intent. AWS Builders’ Library on retry-safe APIs
For a local write, I want the applied receipt and the record update to become durable together. If the process can fail after the update and before the receipt, the next run has to cope with the write already having happened. I’d use an atomic boundary where possible. If a write also triggers a downstream update, record an outbox entry alongside the local write, give the downstream effect a durable identity, and test deduplication at the receiver. A clean retry inside the importer says little about what the downstream system has already received.
The failure and retry timeline
| Time | Event in the fictional import | Expected outcome |
|---|---|---|
| 09:00 | Worker receives file F and begins writing valid records | Stable source keys resolve to catalog records. Each applied operation gets a durable receipt. |
| 09:02 | The fortieth record commits and the worker stops before acknowledging progress | The committed writes and their receipts survive. The batch remains incomplete. |
| 09:04 | A person approves a description edit on one committed record | The approved field and its provenance remain authoritative for that field. |
| 09:05 | The same file and operation identities arrive again | The worker sees the committed receipts, skips duplicate effects, and continues unfinished work. |
| 09:06 | One unfinished row could refer to either of two products | Hold the row with both candidates and the reason. Preserve the rest of the run. |
| 09:07 | Reconciliation runs | Check the expected identity set and protected fields against applied, skipped, and held receipts. Report the exception explicitly. |
The timeline is a proposed acceptance test. It shows which facts should survive the interruption and how a later approved edit should be handled. It doesn’t describe an outage or a production result.
Decide what the importer owns
In the fixture, the person’s approved description survives. If the file contains an updated weight and the source owns that field, the importer can apply the weight while preserving the description. If the source is supposed to overwrite both fields under some circumstances, I’d want that policy documented and the conflict checked against the current record version when the write commits. Otherwise, the importer can decide what to preserve using a read that went stale while someone was editing.
Checkpointing makes the retry practical. A receipt or checkpoint should describe verified durable work and how to resume it. An offset alone can drift if a file is reordered or edited. I’d finish with reconciliation by identity so equal row counts can’t mask one duplicate and one omission.
I’d accept the fixture after it passes these checks:
- Stop after a commit but before acknowledgment. Replay the same input and verify a single record and a single downstream effect per intended operation.
- Make an approved edit between runs and verify that it survives. Test a concurrent edit during replay as a separate case.
- Inject an ambiguous row and verify that it can be reviewed and retried independently.
- Compare the final record identities, field values, and exception receipts to the fixture’s expected outcome.
What transfers
For the person deciding whether to release, the question is who can recover the system and what work survives when they do. For the engineer, take the same sample file that works in the demo and put the interruption between the write and the acknowledgment. That is where the second run stops behaving like the first.
Try this with one high-value import on a disposable fixture. For the related question of how a rollout holds up when the underlying state changes, see Configuration Management Is Your Reliability Layer.
