Skip to main content

Module protected_transaction

Module protected_transaction 

Source
Expand description

two-phase coordination of protected health-check headers Two-phase coordination of the protected health-check headers of a cluster across the main process and every worker.

The main-process SetProtectedHealthCheck task uses Transaction, while each worker uses WorkerStore for its staged and committed versions. Their causal rules are described below.

Main side, Transaction: it proposes a ProtectedHeaderChange in the ProtectedHeaderJournal and walks every targeted worker through prepare (validate and stage), commit (apply) and, when anything fails, abort (drop the staged proposal, or undo the applied one). The journal confirms the proposal only when every worker acknowledged the commit; it rejects it otherwise, once every worker is known to be coherent again. A worker that cannot be made coherent is reported, to be restarted: a restarted worker holds no value, which is coherent and probes nothing.

A transaction carries a cluster id, a ProtectedHeaderVersion, a phase and per-worker acknowledgement flags. It never carries a value, a fingerprint key or an encoded order, so a task may persist it.

Worker side, WorkerStore: it resolves only versions it holds, applies them in version order whatever the order of arrival, and keeps the state before the applied version until it is released, so that an abort after a commit restores exactly that state.

Structs§

Payload
The configuration of a cluster together with the values its headers name.
Transaction
One in-flight change of the protected headers of a cluster, as the main process sees it. Persistable: see the module documentation.
WorkerStore
The versioned protected headers one worker holds. No serde, no Clone, and Debug prints counts only.

Enums§

BeginError
Why a Transaction could not begin. Nothing was proposed.
Commit
What a commit did on a worker.
Order
What the owner of a Transaction sends next.
Outcome
How a finished Transaction ended.
Phase
Where a Transaction stands.
StageError
Why a worker refused to stage a version.
Step
What the owner of a Transaction does after an event.

Type Aliases§

WorkerId
Identity of a worker within one transaction.