fly-apps / fly-apps/postgres-flex

Panic when the number of replicas is bigger than `max_wal_senders`

Open
#176 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
171
Forks
76
Avg merge
1h 19m
Merged PRs (30d)
1

Description

When you try to add one replica beyond `max_wal_senders` it panics on boot.
```sh
P2023-03-20T22:09:14Z app[21781770c63089] den [info]Provisioning standby
2023-03-20T22:09:15Z app[21781770c63089] den [info]repmgr -h fdaa:0:c688:a7b:d5a6:6646:f15a:2 -p 5433 -d repmgr -U repmgr -f /data/repmgr.conf standby clone -c -F
2023-03-20T22:09:22Z app[21781770c63089] den [info]panic: failed to clone primary: failed to clone primary: exit status 1
2023-03-20T22:09:22Z app[21781770c63089] den [info]goroutine 1 [running]:
2023-03-20T22:09:22Z app[21781770c63089] den [info]main.panicHandler({0x9a0c40?, 0xc0004303e0})
2023-03-20T22:09:22Z app[21781770c63089] den [info] /go/src/github.com/fly-examples/fly-postgres/cmd/start/main.go:100 +0x55
2023-03-20T22:09:22Z app[21781770c63089] den [info]main.main()
2023-03-20T22:09:22Z app[21781770c63089] den [info] /go/src/github.com/fly-examples/fly-postgres/cmd/start/main.go:34 +0xadd
```

We should handle this gracefully by logging an error or even return one to the user. Perhaps we should even automatically check the `max_wal_senders` setting and optionally update it before adding the new replica.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.