Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crates/agent: authorization API uses DB snapshots
Update the API to fetch on-demand snapshots from the DB of authorization state, bounding both the frequency with which snapshots may be taken and also for how long a stale snapshot may be used. A request will either succeed against a current snapshot (happy fast path), or will fail. If it fails, the caller is asked to retry after a given delay, and meanwhile the API will have typically started to refresh the current snapshot. If the request continues to fail against a snapshot which as taken _after_ the issued-at time of the request token, only then is the error considered permanently failed. This means that requests are cheap, evaluted only by the agent-api, but we *also* don't have caching artifacts that could result in false errors when tasks or collections are being created or changed. Instead, we incur a minor delay while a sufficiently-recent snapshot is taken. A final change is that we now prefix match on shard ID templates and journal name templates, rather than munging both into a more-approximate prefix match over catalog names.
- Loading branch information