Replica mirror (the local Snapshot) #4

Closed
opened 2026-09-13 20:39:59 +00:00 by ginjiruu · 0 comments
Owner

Parent

Spec: Shared in-memory state model (Registry + Snapshot) — #1

What to build

Every replica watches the managed Registry Secret and the referenced per-App Secrets, and maintains its local in-memory Snapshot. On any change it rebuilds the whole block and atomically swaps the pointer (lock-free read; the hostname index and App set are built together; rapid changes are coalesced). The per-replica "bytes present" (which drives the 5xx flag) is derived from the local Secret watch — the behaviour side, immediate and leader-independent.

Acceptance criteria

  • On a Registry or referenced-Secret change, the Snapshot is rebuilt and the pointer atomically swapped (a serving read can never see a half-updated state).
  • The read path is lock-free (a single pointer load).
  • The hostname index and the App set are built together and can never disagree.
  • Rapid successive changes are coalesced into a single rebuild.
  • The per-replica "bytes present" is derived from the local Secret watch; when a referenced Secret is deleted, that App's bytes-present flips false (→ 5xx), and on recreation flips true.
  • A fresh replica builds its Snapshot by watching the Registry + referenced Secrets (5xx for any App whose Secret is absent) without a leader round-trip.

Blocked by

  • #3 — Registry builder (the leader's core)
## Parent Spec: Shared in-memory state model (Registry + Snapshot) — https://git.animeteamspeak.moe/lab/authz-bridge/issues/1 ## What to build Every replica watches the managed Registry Secret and the referenced per-App Secrets, and maintains its local in-memory Snapshot. On any change it rebuilds the whole block and atomically swaps the pointer (lock-free read; the hostname index and App set are built together; rapid changes are coalesced). The per-replica "bytes present" (which drives the 5xx flag) is derived from the local Secret watch — the behaviour side, immediate and leader-independent. ## Acceptance criteria - [ ] On a Registry or referenced-Secret change, the Snapshot is rebuilt and the pointer atomically swapped (a serving read can never see a half-updated state). - [ ] The read path is lock-free (a single pointer load). - [ ] The hostname index and the App set are built together and can never disagree. - [ ] Rapid successive changes are coalesced into a single rebuild. - [ ] The per-replica "bytes present" is derived from the local Secret watch; when a referenced Secret is deleted, that App's bytes-present flips false (→ 5xx), and on recreation flips true. - [ ] A fresh replica builds its Snapshot by watching the Registry + referenced Secrets (5xx for any App whose Secret is absent) without a leader round-trip. ## Blocked by - #3 — Registry builder (the leader's core)
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lab/authz-bridge#4
No description provided.