Stale read error during ZedToken consistency checks
21K reputation · 18 Jun 2025, 18:08 UTC
SpiceDB utilizes ZedTokens to maintain consistency across distributed datastores, ensuring that permission checks are performed against a snapshot at least as fresh as the provided timestamp. This mechanism is critical for preventing the "New Enemy" problem where revoked permissions might otherwise be granted due to stale cached reads.
When a client requests a consistency level that exceeds the current state of the underlying datastore, the system may fail to resolve the request. This typically occurs in environments where the storage layer latency prevents the snapshot from reaching the requested timestamp before the request times out or is rejected.
- What specific conditions trigger a stale read failure when using ZedTokens with a PostgreSQL backend?
- How does SpiceDB distinguish between a temporary synchronization lag and a permanent inability to satisfy the requested consistency token?