Skip to main content

Module quota_cache

Module quota_cache 

Source
Expand description

Short-TTL per-namespace concurrency-quota cache for the dispatcher’s keyed backpressure (Control-Plane Phase 2, P2-Q2). Short-TTL in-process cache of per-namespace concurrency quotas, read by the non-replayed outbox dispatcher’s keyed backpressure (Control-Plane Phase 2, P2-Q2).

The dispatcher consults a namespace’s cluster-wide max_in_flight_activities ceiling on every sweep to compute its per-node headroom. Reading it straight from the durable [NamespaceStore] each sweep would be a per-sweep quorum read on the hot claim loop. This cache front-runs get_namespace, holding each namespace’s quota for a short TTL so the steady-state path is a lock + map-lookup, never a store round-trip — the same pattern as PlacementCache.

Staleness is benign: the quota is the cluster-wide contract, enforced per-node as a proportional share with generous defaults, so a stale entry only over- or under-admits slightly for at most one TTL window and self-corrects on the next refresh. Backpressure never drops or fails a row — an over-admit at worst defers a Pending row one extra sweep — so cache staleness can never perturb correctness or replay (the claim shapes timing only, CP-Phase-2 §3.4).

Structs§

QuotaCache
A short-TTL cache over NamespaceStore::get_namespace’s config.max_in_flight_activities, resolving the platform default when a namespace sets no explicit override.