# etcd watch progress: coverage is not quorum freshness

Research packet for issue #7959, prepared 29 November 2026 CET.
Reviewed native observations and a reproducible method. See
[publication review](publication.md) for the fifth replay and validator correction.

## Finding

A member can emit valid watch progress while its key value is stale relative
to an acknowledged write and a current read from the majority. We reproduced
this on three loopback members running the official Linux amd64 etcd 3.6.16 build.

After all three members held `old` at revision 2, a relay isolated one follower.
The other two committed `new` at revision 3 and an unrelated key at revision 4.
Their current read returned `new` and header revision 4. The isolated follower
returned `old` through a serializable read and emitted two **actual progress
notifications at revision 2**. These were not watch-creation acknowledgements.
Its default current read exceeded the deliberately configured one-second
deadline. The stale value and positive notifications establish the
counterexample; the timeout alone does not.

After healing the relay, a watch from revision 3 delivered the missing update,
then a revision-4 progress notification. Another unrelated-key write moved
progress to revision 5, while the watched key's last modification remained 3.
Thus **a low last-event revision does not, by itself, prove a cache is behind**.

Five clean runs have the same normalized outcome. These are repeatability
checks of a designed case, not independent samples for a failure-rate estimate.
See [generated table](table.md), [results](results.json) and raw captures
[capture-a](capture-a/capture.json), [capture-b](capture-b/capture.json) and
[capture-c](capture-c/capture.json) and [capture-d](capture-d/capture.json), plus the later
[publication replay](capture-publication/capture.json).

## Four observations that must not be conflated

| Evidence | What it establishes in this experiment | What it does not establish |
| --- | --- | --- |
| Last matching event, revision 3 | The watched key changed there | How far the stream has covered unrelated revisions |
| Progress, revision 2 | Delivery coverage of this watch through the local revision | Agreement with the majority at revision 4 |
| Current majority read, revision 4 | A reference revision for a freshness check | That the client has consumed or applied its watch |
| Applied cache after the missing event | The modeled cache now contains new | A permanent guarantee about subsequent concurrent writes |

The [official guide][guide] explicitly distinguishes a watch member's progress
from quorum-read revision. The [API guarantees][guarantees] describe progress
as delivery coverage, while excluding watch linearizability. The
[API description][api] supplies the watch's key range, start cursor and
progress option.

The pinned [RPC loop][rpc] schedules progress requests. The
[MVCC implementation][store] uses the local store revision and requires the
watcher to be synchronized; it also suppresses progress while that revision
is below the requested starting revision. The [stream interface][stream]
orders notifications with event delivery. These explain the native result;
we did not discover a new etcd defect.

## A bounded cache acceptance rule

Hesela's synthesis: obtain a successful **current, linearizable** read with
revision Q in the same cluster history; consume a correctly scoped, continuous
watch until a genuine progress notification P >= Q; then ensure every preceding
matching event has been applied to a coherent cache before serving it.
Start with a valid range snapshot and resume from its revision plus one.
Handle cancellation, compaction, lost history and changed cluster identity
explicitly. Filters that omit necessary changes invalidate a complete-cache
claim.

This bounds the cache against the sampled reference, not all writes that may
finish later. A timed-out reference read provides no usable freshness barrier.
Do not replace progress with the largest matching event revision: the
unrelated-key control has event revision 3 but confirmed coverage through 5.

The separate application boundary is an **explicit dictionary model**: keeping
the received update pending leaves `old`; applying it yields `new`, matching
the native range. We did not instrument a production cache, Kubernetes
informer, concurrency-safe cache implementation or asynchronous executor.
P >= Q alone is not a complete implementation of a linearizable read protocol.

## Protocol and scope

1. Start three fresh members on randomly selected loopback client ports.
2. Advertise three loopback relays as peer URLs; each forwards to a separate
   local backend peer listener. Reuse no real data or credentials.
3. Write one invented watched key and wait for all member-local reads to agree.
4. Identify a follower using native status responses. Block relay connections
   to that follower and those whose peer header identifies it as sender.
   Both streams and pipeline requests carry that identity in the reviewed
   [transport sources][peer]. Close existing matching connections and reject
   new ones; leave majority-to-majority and all client connections available.
5. Perform the writes, reads and watches described above. Record raw JSON,
   command stderr/exit status, relay actions, topology and process lifecycle.
6. Heal the relay, verify recovery and the unrelated-key control.
7. Terminate and reap all three servers and relay threads; delete only private
   disposable member databases. Preserve logs and their hashes.

This is a user-space **peer-communication partition** over plaintext loopback
HTTP, not packet loss in a real network. No firewall rules, host configuration,
production endpoints, snapshots, leases, compaction, authentication or
membership changes are involved. The 100 ms progress setting makes this small
test bounded; it is not a measured delivery guarantee or recommended tuning.

### Failed pilot methods are retained, not counted as results

The initial stop/restart design could not make a stale member serve requests
while alone: its log repeatedly reported failed membership publication.
[Startup code][startup] closes readiness only after publication succeeds.
The incomplete [pilot-startup capture](pilot-startup/capture.json) is excluded
from the successful-run verifier.

A second pilot used a future start cursor 3 while the isolated store remained
at 2. Its bounded wait expired. [The exact source condition][store] explains
why a future cursor is not a way to request an older progress marker.
That incomplete [pilot-future-cursor capture](pilot-future-cursor/capture.json)
does not retain the interrupted watch stream and is **not** used to infer an
absence guarantee. The completed design uses start 0 for that observation;
recovery separately resumes at 3.

## Reproduce

Requirements: Linux amd64, Python 3.11+ standard library and official etcd 3.6.16
`etcd`/`etcdctl` executables. No package install or root privilege is needed.
Download the archive named in [source receipts](source-receipts.json), verify
its publisher checksum, then extract it. The harness rejects executable
hashes other than the recorded build.

From this directory:

```sh
python3 experiment.py --bin-dir /absolute/path/to/bin --output capture-replay
python3 verify.py capture-a/capture.json capture-b/capture.json capture-c/capture.json capture-d/capture.json capture-replay/capture.json
python3 -B -m unittest -v test_evidence.py
python3 -O -B -m unittest -v test_evidence.py
python3 report.py
```

Allow 1 GiB temporary headroom for three etcd WALs. The output directory must
not exist. A port-allocation race is an experiment failure, never permission
to kill another process. Logs/cluster IDs/ports/timestamps differ across runs;
logical outcomes must agree. A global kill of the Python process is outside
its ordinary-exception cleanup guarantee.

`verify.py` does not import the experiment. It checks identities, topology,
scope, values, revisions, event ordering, reference mode, cleanup and log hashes.
Mutation tests reject missing events, creation-as-progress, changed cluster,
wrong read mode and fabricated fresh progress. Validation remains active with
Python optimization. `report.py` regenerates the JSON and table from validated
captures, including every completed `capture-*` directory.

## Relationship to Hesela

This supplies native evidence for the existing
[consistency and ordering analysis][hesela] and
[strict-serializability entry][term]. It is distinct from the snapshot
rollback/cursor study #7918 and key-incarnation study #7895.
The existing article and term carry the publication; no new entity is needed.
The historical proposal is retained in [integration.md](integration.md).

Original code, synthetic fixtures and authored analysis: MIT, see [LICENSE](LICENSE).
Upstream binaries are Apache-2.0 and are not redistributed here. Source pages
are referenced with access dates, locators and SHA-256 receipts, not copied.

[guide]: https://etcd.io/docs/v3.6/dev-guide/interacting_v3/#watch-progress
[guarantees]: https://etcd.io/docs/v3.6/learning/api_guarantees/#watch-apis
[api]: https://etcd.io/docs/v3.6/learning/api/
[rpc]: https://github.com/etcd-io/etcd/blob/v3.6.16/server/etcdserver/api/v3rpc/watch.go
[store]: https://github.com/etcd-io/etcd/blob/v3.6.16/server/storage/mvcc/watchable_store.go
[stream]: https://github.com/etcd-io/etcd/blob/v3.6.16/server/storage/mvcc/watcher.go
[peer]: https://github.com/etcd-io/etcd/blob/v3.6.16/server/etcdserver/api/rafthttp/stream.go
[startup]: https://github.com/etcd-io/etcd/blob/v3.6.16/server/etcdserver/server.go
[hesela]: https://hesela.com/analyses/storage-consistency-ordering/
[term]: https://hesela.dev/terms/strict-serializability/
