﻿# Choose etcd read consistency for the decision being made

A serializable etcd read can serve stale member-local state; choose the read contract and transaction boundary according to the coordinator’s decision.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/etcd-linearizable-read-path/
Language: en

## A fast read can answer the wrong operational question

A distributed coordinator records that a partition is assigned, then another process checks whether it remains available. If that check uses a stale member-local view, both processes may believe they can start work. The important distinction is not whether etcd returned a valid response. It is whether the requested consistency contract supports the decision being made. A dashboard showing approximate progress and a coordinator deciding exclusive ownership have different requirements, even when both read the same key and both tolerate ordinary network latency.

## Read the documented consistency contract

The [etcd API guarantees](https://etcd.io/docs/v3.6/learning/api_guarantees/) describe linearizability as an operation taking effect at a point between invocation and response. A read beginning after a completed write must respect that real-time ordering. The [Range API](https://etcd.io/docs/v3.6/learning/api/) is linearizable by default; setting `serializable` selects a member-local read that can be stale relative to quorum state. The option's name should not be interpreted as a promise of the same freshness. A linearizable result also does not mean that no concurrent writer can change the value before the client receives it or acts upon it.

## Separate freshness from exclusive ownership

Suppose a controller reads an available job and later writes an owner identifier. Another controller can make the same read before either write occurs. Choosing the stronger read mode does not turn those separate operations into one atomic decision. Where acceptance depends on unchanged state, use the documented transaction comparison against the expected value or revision and inspect the transaction outcome. Treat the read as evidence about one observation point, not as a lock on the external job runner, a reservation of hardware or permission for every subsequent operation.

## Record the path and revision before changing policy

Identify the client option actually sent, the endpoint used and the cluster identity in the response. Preserve the requested key range, response revision and relevant key modification revision. This avoids comparing a historical query with a current query or mistaking another cluster for a lagging member. Check the caller's error handling as well: a timed-out operation is not equivalent to a successful stale read. [Client and peer address boundaries](/journal/guide-dc-etcd-advertised-url-boundary/) explain why a reachable bootstrap endpoint alone does not establish the path used by later requests.

## Test the ordering that the application requires

In an isolated test, complete an identified write, then issue the read whose result controls the next step. Retain the write acknowledgement, the read's consistency setting and returned revision. Compare that case with concurrent controllers attempting the same conditional transition. Acceptance requires the stronger-read path to respect the completed write and the conditional-update path to reject a stale expectation. Do not demand that an unconstrained serializable read always produce an older value; a local member may already be caught up. Absence of observed staleness in a convenient test does not strengthen its contract.

## Keep the resulting claim bounded

Use weaker reads only where the application explicitly tolerates their possible staleness and can describe its consequences. Measure any performance difference on the actual workload instead of copying a documentation example into a latency promise. Watches have their own ordering and delivery contract; they are not interchangeable with a fresh Range request. [Watch-cache recovery after restore](/journal/guide-dc-etcd-restore-watch-revisions/) addresses a separate revision-continuity problem. The accepted design records which decision needs current consensus state, which can tolerate an older observation and which requires a transaction rather than any standalone read. That record remains useful when clients, topology or retry behavior change.
