diff --git a/docs/configuration/pgdog.toml/general.md b/docs/configuration/pgdog.toml/general.md index a957134..917b458 100644 --- a/docs/configuration/pgdog.toml/general.md +++ b/docs/configuration/pgdog.toml/general.md @@ -226,9 +226,12 @@ Available options: - `include_primary` - `exclude_primary` +- `include_primary_if_replica_banned` Include primary uses the primary database as well as the replicas to serve read queries. Exclude primary will send all read queries to replicas, leaving the primary to serve only writes. +Include primary if replica banned strategy will only send reads to the primary if one or more replicas have been banned. This is useful in case you want to use the primary as a failover for reads. + Default: **`include_primary`** ### `healthcheck_port` diff --git a/docs/features/load-balancer/index.md b/docs/features/load-balancer/index.md index 2d96225..4a931d4 100644 --- a/docs/features/load-balancer/index.md +++ b/docs/features/load-balancer/index.md @@ -186,6 +186,15 @@ This behavior is configurable in [pgdog.toml](../../configuration/pgdog.toml/gen read_write_split = "exclude_primary" ``` +#### Failover for reads + +In case one of your replicas fails, you can configure the primary to serve read queries temporarily while you (or your cloud vendor) bring the replica back up. This is configurable, like so: + +```toml +[general] +read_write_split = "include_primary_if_replica_banned" +``` + ### Manual routing !!! note "New feature"