Expand description
The ingest rules. See the crate documentation for what each covers.
Each rule is an async function taking impl AsyncFn() -> F, how to make a
fixture rather than a fixture, as in the event-store family, and returning
Result<RuleOutcome, Violation>.
§What no rule here does
Decode a payload (SY-35). Events are compared whole, identity, recorded time and the opaque bytes, and never parsed.
Assert a local position it did not read back. The specification permits gaps, so every local position compared is one the store assigned. The literal positions below are origin positions: facts a peer supplies.
Locate an event by identity, except VT-5’s. The other rules find what they wrote by its distinct opaque bytes, so a store that re-mints on ingest fails VT-5’s rule and only that one.
Assume an identity the store did not state. Each rule awaits the
store’s store_id before it
arranges anything, and a failed read is a violation of the rule’s own
clause rather than a reason to carry on.
Functions§
- an_
unheld_ own_ identity_ stops_ the_ ingest - SY-38: an event claiming the store’s own identity at a position the
store did not hold when the call began refuses the whole call as
[
IngestError::UnheldOwnIdentity], class [FailureClass::Stop], and writes nothing. A held own identity is a re-delivery, and a skip. - bulk_
ingest_ is_ idempotent_ in_ bounded_ round_ trips - SY-14: a pulled batch lands in one ingest call, however many of
its events the store already holds, and the same call again changes
nothing. With VT-24 on the ingest path: the call is
MIN_SUPPORTED_EVENTS_PER_BATCHforeign events, the push the minimum peer declares it takes, and every store takes it. - dedupe_
reaches_ identity_ without_ decoding - SY-12: a re-delivery is decided on the event’s identity alone, which the store reaches without decoding a byte of the payload. With SY-11’s store half: a group that was wholly a re-delivery writes no compensation.
- directional_
merge_ rules_ compose - SY-10: the runner may give each direction of one edge its own merge rule, and a store takes what each direction hands it, judging nothing itself.
- ingest_
group_ is_ atomic_ under_ a_ mid_ group_ fault - SY-30: an [
IngestGroup] lands whole or not at all, even when the store fails between two of its rows. - ingest_
holds_ the_ call_ to_ its_ tags_ per_ batch_ ceiling - VT-36 on the ingest path: a store that declares a tags-per-batch
ceiling holds the whole call to it, every foreign event and every
compensation event of every group counted together, and refuses a call
one tag over as [
IngestError::ExceedsStoreLimit] namingStoreLimit::TagsPerBatchand the call’s total, class [FailureClass::Split], with nothing written (ADR-0100). SY-18 is why the refusal has to be a true one. - ingest_
preserves_ origin_ identity - VT-5: an ingested event keeps the
EventIdits origin minted. - ingest_
preserves_ the_ recorded_ time - VT-9: an ingested event keeps the
RecordedAtits origin carried, unchanged; a store stamps only what it accepts from a local append. - ingest_
validates_ every_ event_ not_ the_ head - SY-18: a store holds every event an ingest writes to the per-event ceilings it declares, not the head of each group, and an event over one refuses the whole call.
- ingested_
events_ land_ above_ the_ local_ head - SY-5: an ingested event, and its compensation, land at the tail, above every position assigned before the call, and the log below the old head is unchanged.
- only_
the_ adjudicator_ compensates - SY-7: a compensation is written only by the store the assignment names the fact family’s adjudicator, and filed under that store’s own identity, which is how a log records who authored it.