Skip to main content

validate_write_pool_is_primary

Function validate_write_pool_is_primary 

Source
pub async fn validate_write_pool_is_primary(db: &Database) -> DatabaseResult<()>
Expand description

Rejects a write pool that resolves to a streaming-replication standby.

Every write path — schema installation, extension seeds, the job scheduler, log persistence, and LISTEN/NOTIFY on the event bridge — goes through Database::write, which falls back to the read pool when no separate write URL is configured. A read URL aimed at a replica therefore turns into a slow, opaque boot failure: DDL stalls, then jobs die on 25006. Failing here names the cause instead.