macula_provider_standing (macula v17.1.1)
View SourceThe node's last reading of each provider's delegation slot, shared by every stream that follows that provider (macula#120): a node holding N streams to one provider under one org key reads the slot once per re-check, not N times.
A follower asks read/3 with its key, {Provider, OrgKeyId}, the read it would make and its re-check interval. A reading younger than half the interval is answered as it is, and the follower asks again one interval later, so the withdrawal reaches it within one and a half re-checks plus a lookup: the worst case is a reading taken just before the tombstone landed and answered when almost half an interval old. A missing or older one is claimed by the first asker, atomically, and that asker makes the one read and stores its answer; every other asker meanwhile waits for that answer rather than taking the last one, so no follower learns of a withdrawal later than the one that read it. A read that raises is stored as lookup_failed, and an asker that waits longer than a lookup can take answers lookup_failed: neither is evidence of revocation. A claim older than that wait, its claimant gone mid-read, is claimed again by the next asker. Callers read and write the table themselves; this process owns it and sweeps readings older than ten minutes. Without the table, between an owner's exit and its restart, read/3 reads directly.
Summary
Functions
The standing of the provider and org key Key, from a reading younger than MaxAgeMs, or from Read().
Types
-type key() :: {<<_:256>>, <<_:256>>}.
-type standing() :: ok | {error, term()}.
Functions
-spec read(key(), fun(() -> standing()), pos_integer()) -> standing().
The standing of the provider and org key Key, from a reading younger than MaxAgeMs, or from Read().