AccessWalking
The access walks of one bounded context, on every node, every AccessStampOptions.interval: each aggregate type's history stamped with the attributes of its aggregates' current states, where no commit stamped it with the type's current access schema (AccessSchema): a log an earlier version wrote, an import, an attribute the model declares since, an access revision it raised since (a changed derivation of the same attributes).
Claims: the type's log records one walk of the type (AccessWalks.walk), of an access schema, with the log's heads when it was claimed. A node claims its own schema's when none is recorded, and in place of another schema's once no node of that one is left (each node is a member of
<group>#access, serving<aggregate>@<schema hash>for its schema of each type, heartbeated on a timer of its own from enter until stop whatever a run takes, AccessMembership): a rolling deployment that changes the schema starts the walk once the last node of the old one stopped, so the walk reaches what that node wrote. A walk of this node's schema, once completed, is not read again. A type whose log holds no store of its history yet (AccessWalks.holds) is not claimed, and its store is not created. The step that creates it records the walk completed for this node's schema, which the node's assembly tells each log (serve), since every stream it then holds was committed with its attributes; a store another writer created (an import, a tool) records none, and the first run after its first append claims its walk.The walk: the node that holds the type's walk lease (
<group>#access-walk/<aggregate>) pages its aggregates (AccessWalks.aggregates, at most AccessStampOptions.walkBatch a page) and stamps each one's whole history with its current attributes (stampCurrent), one aggregate after another, each in statements of its own. After each page it records its cursor and count, so another node or a restart resumes it there; past the last page it is completed.Its pace: the walk is background work on the store the commands write to, so it takes a bounded share of it by construction (WalkPace): after each aggregate it waits so that its stamping took at most AccessStampOptions.walkShare of the time, and so that it stamps at most AccessStampOptions.walkRate a second. Its own statements slow down as the store's load rises, from any node, and the pace with them. Each second it reads whether the log store's writes pressed (ReplayGate.pressed): the share halves while they do, down to an eighth, and comes back an eighth a second while they do not. Its history reads run under the log store's query bulkhead (ReplayGate.replay); one the bulkhead refuses is a press too, and the aggregate is read again. A page holds as many aggregates as the last pace stamps in an interval, so the walk records its cursor about every interval, and it renews its lease within a page and while its pace waits (WalkLease). A renewal that answers nothing stops the run, which records nothing more: another node may walk the type now.
After the heads: the walk reaches every stream up to its heads. A stream after them that carries no attributes (a node of an earlier version still running, an import) is the follower's: AccessStamping stamps its aggregate when it reads it (covers).
An aggregate it cannot read: one whose history does not replay, or whose read or stamps fail in a way no retry changes, is parked under
wow.access.walk(skips) and the walk goes on; any other failure stops the run, which resumes at the cursor. A skipped aggregate's history keeps the attributes it was stamped with before, or none, and an operator retries it (retry) or skips it. Without skips, every failure stops the run.
The walks are observable in the registry of each log (the walk's schema, heads, cursor, count and completion), in the observer's ObservedEvent.AccessWalked, ObservedEvent.AccessStamped and ObservedEvent.MaintenanceSkipped, and in the log.
Constructors
Properties
Functions
Makes this node a member of the context's walks before it accepts commands, so a node of another schema reads it among them (claim) before it appends, and keeps it one from now until stop, heartbeated in scope at once and then every third of AccessStampOptions.memberTtl, whatever a run takes: the node's assembly calls it once the node is ready to join, at its start or at its activation from standby.
type's log as its store gives it, before the hand-over wraps it: what stamps and walks its history.
The walk of type of this node's access schema, as this node last read or claimed it; null while the log records none, or another schema's, which stays while a node of that schema is left (claim): a rolling deployment's that changes the schema, completed or not, says nothing of this node's, which has not started.
An operator's retry of ref, which the walk skipped: its history stamped with its current attributes, as the walk does; true when it is, and its entry resolved. A failure that skips it leaves the entry as it is.
Tells each type's log the access schema this node serves for it (AccessWalks.serve), before the log creates any of their stores: a store it creates then records its walk completed. The node's assembly calls it.
The share of the time the walk of type takes now on this node (WalkPace.share); null before it walked here.
Adds stamps, another store of type's history (an index of its streams, which a sink writes and follows the changes of itself), to what stampCurrent stamps: a walk reaches what it wrote before.
The walk of each type, as this node last read or claimed it.