Skip to content

Update Path

The update path is how a new configuration reaches a running reader. The agent validates and publishes; the reader only notices and attaches. A reader starts no thread: the lookup that sees a change does the work, or refresh() does it earlier from a thread the application picks.


The agent publishes a generation, replaces selected and moves the change sequence; the next lookup sees the moved sequence, one thread attaches the new generation and publishes a view, and the old view is freed once its readers drain
  1. Publish. The agent writes a new immutable generation, then atomically replaces the selected table, then moves the namespace’s sequence in the change file. The table has an entry per namespace, each with its own sequence.
  2. Notice. Each lookup loads its namespace’s sequence from the mapped change file, so a publish in another namespace moves nothing it reads.
  3. Attach. One thread wins refreshing, re-reads selected, attaches each namespace whose entry names a new generation and publishes a new view. Everyone else keeps reading the installed view.
  4. Retire. A handle keeps at most four views. An old view is freed only once its counters sum to zero, so no reader ever reads freed memory.

A generation that fails verification, a refused directory or a lease that can’t be taken frees what the attempt built and keeps the installed view. Lookups keep answering from it until the sequence moves again or refresh() runs. A revision that goes backwards within one incarnation is refused.

A namespace with no generation yet answers each call’s fallback with the status UNAVAILABLE. A store that doesn’t exist yet opens; the reader retries it at most once per 200 ms.


Validation happens in the agent, completely, before a generation is selected: the delivery’s authentication, framing and schema, then the generation’s records and digests. The reader checks ownership, mode and ACLs of the store and every record it opens, and verifies each page against its digest on first touch. See Delivery and Local Images and Snapshot Format.


Pre-forking servers inherit handles. A child forked while another thread is mid-lookup or mid-refresh keeps a working handle and sees the next publish.