FM-040 Distributed Systems and Data Consistency

Database Transaction and Atomicity Failures

Only some database operations commit on error, leaving incomplete records, inconsistent relationships, or partially updated data.

Failure explanation

A single API operation performs multiple related database changes, but an error causes only some of them to persist. This can leave orphan records, inconsistent totals, broken relationships, or a business operation that appears complete when it is not. Problems may also arise from incorrect transaction boundaries, isolation levels, or handling of concurrent updates.

Example

Creating an invoice inserts the invoice header and then fails while inserting its line items. The API returns an error, but the header remains committed with no lines, and downstream reporting treats it as a valid invoice.

How to test

  • Inject failures between database writes and verify rollback behavior.
  • Test constraint violations, deadlocks, concurrent transactions, and transaction isolation.
  • Inspect persisted state after both success and failure.
  • Distinguish single-database atomicity from multi-service workflows, which need separate distributed coordination.

Expected behavior

Operations documented as atomic either commit all required changes or leave no partial state. Where atomicity is not possible, the API exposes a recoverable workflow and consistent status.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.