Operations
What to watch
Section titled “What to watch”rebac.status() is one row, readable from SQL:
select * from rebac.status();| Column | What it tells you |
|---|---|
heartbeat_age_ms |
Age of the newest daemon heartbeat. Reads fail closed past max_staleness_ms. |
stale |
Whether reads are failing closed right now. |
pending_outbox |
Relationship writes not yet delivered to SpiceDB. |
quarantined |
Rows SpiceDB refused, held with their error for a person to look at. |
refresh_queue |
Principals waiting to be re-projected. |
external_writes |
Relationship changes seen on Watch that did not come through rebac.write. |
unavailable_principals |
Principals that read as RB503 until they are refreshed. |
The daemon serves the same row as JSON at GET /status, and GET /healthz answers ok while the process is up.
/status is a 503 when the database cannot be reached.
What each one usually means:
staletrue: the daemon is down, or cannot reach SpiceDB or Postgres. Every fenced read isRB503until it beats again.pending_outboxgrowing: the relay is not delivering. Revocations are still in force locally; grants wait.quarantinedabove zero: a write SpiceDB refuses on its own. The relay keeps going around it.external_writesabove zero: something writes SpiceDB directly. Those revocations are narrowed by the sweep, not at commit.
REBACD_LOG_FORMAT=json writes one JSON object per line. A failure is logged by its kind
(postgres:<SQLSTATE>, grpc:<code>, pool, io, other), never its text, so log lines carry no tenant content.
The full text stays on the queue row, for example rebac.refresh.last_error.
Checks to schedule
Section titled “Checks to schedule”rebacd verify --all-tenants --sample 200 # one line of totals; exits 2 on any extra rowrebacd verify --isolation # no principal id reads across tenantsrebacd verify --closure # the stored closure still matches the schemaAlert on exit status 2. Extra rows are a fence violation; missing rows are a freshness gap and are reported separately.
Prove before you switch
Section titled “Prove before you switch”- Install
rebac.sqlbeside whatever you use today. Nothing reads it yet. - Run
rebacd run --shadowandrebacd backfill --tenant <t> --shadow. Shadow mode writes onlyrebac.readable_shadowand relays nothing. - Compare with
rebacd verify --tenant <t> --shadow, or against SpiceDB, until extras and missings are both zero. - Then point reads at
rebac.readable_set, keeping your current path behind a flag.
Rolling back
Section titled “Rolling back”The projection is a cache of SpiceDB plus pending revocations, so it can be rebuilt with rebacd backfill at any
time. To step back:
- Reads: switch your read path back to its previous source. Nothing in pg_rebac needs to change.
- The daemon: stopping it is safe for revocations written through
rebac.write, which narrow at commit without it. Reads start failing closed aftermax_staleness_ms; that is the bound doing its job. - Live to shadow: restart with
--shadow(ormode = "shadow"). Relaying stops and only the shadow table is written.
pg_rebac has no uninstall script in slice 1.