Module journal

Module journal 

Source
Expand description

The shard’s delta journal.

A shard renders once and journals one delta per version. Connections replay the slice they have not seen yet, which is what makes a delta cost O(N·|D|) to distribute rather than O(N·W).

§There is no snapshot mechanism to write

A newcomer receives plan(empty view, current view) - the ordinary planner. A departure is the inverse. A migration is both. Nothing here needs to know about any of that, which is why this module has no view vocabulary at all.

§Falling off the tail closes the connection

A connection whose cursor has dropped below Journal::tail cannot be repaired from deltas, and it is dying anyway: its output queue holds a thousand messages. It is closed and reconnects from scratch.

REF: docs/design/guide-implementation.md 8.1

Structs§

Journal
Deltas for versions tail + 1 ..= head.
TooFarBehind
A connection asked for history the journal no longer holds.

Constants§

DEPTH
How many versions of history the journal keeps.