Eventual Consistency and Read-After-Write Failures
Reads immediately after a write return stale data because of asynchronous replication, without clear consistency guarantees communicated to the consumer.
Failure explanation
A write succeeds at one component, but a subsequent read returns an older representation because data is replicated or propagated asynchronously. This may be an expected consistency model, but failures occur when the API does not document the delay, violates its stated guarantee, or gives clients no way to determine when the new value is visible. Consumers may retry writes and create additional side effects.
Example
PUT /profiles/42 returns the updated email address. An immediate GET /profiles/42 is served by a lagging replica and returns the old email for several seconds, despite the API promising read-after-write consistency.
How to test
- Perform writes followed by reads through different replicas, caches, and routes.
- Measure propagation delay and test concurrent updates.
- Compare observed behavior with documented consistency guarantees.
- Verify polling, version markers, or read-your-writes mechanisms where provided.
Expected behavior
The API meets its stated consistency model and exposes enough information for consumers to handle expected propagation delays. Do not classify documented eventual consistency as a defect merely because reads are not instantaneous.
Runnable examples
Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.
Learn how to find and fix it