Software Architecture / Editorial solution guide

A retry creates a duplicate reservation

Trace operation identity, commit boundaries, and business effects before correcting a retry contract.

About 3 min readContent reviewed

Read-only knowledge base ยท No public comments

Recognize the symptoms

A synthetic reservation request times out and its retry creates two reservations. The first request may have committed before its response was lost. Preserve operation identifiers, timing, and data state without exposing real customer data.

Understand the likely causes

  • The client may generate a new key per attempt, the key record may be inconsistent with the business effect, concurrent requests may race, or retention may expire before retry. Duplicate delivery alone does not identify which gap occurred.

Trace the logical operation

Using synthetic data in an isolated environment, correlate the client attempts, operation key, request fingerprint, server state transitions, and resulting reservations. Record timing and the point at which the response was lost. Compare the intended business invariant with durable state; a timeout does not prove the first transaction failed. Avoid collecting secrets or real customer payloads, and preserve evidence before deleting or modifying any duplicate records.

Inspect the consistency boundary

Check whether retries reuse the same key and whether the service coordinates its durable key record with the business effect. Examine concurrent requests, in-progress state, key scope, payload mismatch behavior, and expiry. A cache-only marker can disappear independently of a committed effect. Do not assume a transaction spans unrelated systems; document the actual owner, commit boundary, and recovery behavior. Confirm authorization is enforced when clients query a previous result.

Test a bounded correction

Agree on a contract for key lifetime, request matching, in-progress responses, and recovery with the service and business owners. In the lab, change one identified cause and retain the previous design and rollback plan. Test repeated and concurrent requests, a lost response after commit, and reuse of a key with different content. A deduplication key is not an authorization credential; verify that another identity cannot retrieve the result merely by knowing it.

Verify the business invariant

Repeat the original timeout-and-retry scenario with synthetic data. Verify one intended reservation, a documented response or status to the client, and correct behavior after recovery. Check that conflicting payloads and expired keys follow the contract, and observe errors and latency so the fix does not hide another failure. Record test limits and any existing duplicates requiring separate owner-approved remediation; a successful unit test alone does not prove every downstream effect is safe.

Verify the fix

Repeat timeout, retry, and concurrency scenarios with synthetic data; verify one effect, an authorized result, conflict handling, and recovery.

Keep it from recurring

  • Document key scope, lifetime, consistency boundary, and authorization, and test commit failures and duplicate requests before changing the contract.

Official references