Skip to content

Commit 8e6e511

Browse files
authored
Document replica banned rw split strategy (#38)
1 parent 59aada0 commit 8e6e511

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/configuration/pgdog.toml/general.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,12 @@ Available options:
226226

227227
- `include_primary`
228228
- `exclude_primary`
229+
- `include_primary_if_replica_banned`
229230

230231
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.
231232

233+
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.
234+
232235
Default: **`include_primary`**
233236

234237
### `healthcheck_port`

docs/features/load-balancer/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ This behavior is configurable in [pgdog.toml](../../configuration/pgdog.toml/gen
186186
read_write_split = "exclude_primary"
187187
```
188188

189+
#### Failover for reads
190+
191+
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:
192+
193+
```toml
194+
[general]
195+
read_write_split = "include_primary_if_replica_banned"
196+
```
197+
189198
### Manual routing
190199

191200
!!! note "New feature"

0 commit comments

Comments
 (0)