I was trying to increase the shared buffers size for Postgres using
flyctl postgres config update --shared-buffers
After which I restarted using
fly postgres restart
Now it’s just in a loop trying to start and failing:
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:02.673Z INFO postgresql/postgresql.go:319 starting database
app[e1baca0d] mia [info] keeper | 2022-11-21 15:34:02.690 UTC [2271] FATAL: could not map anonymous shared memory: Cannot allocate memory
app[e1baca0d] mia [info] keeper | 2022-11-21 15:34:02.690 UTC [2271] HINT: This error usually means that PostgreSQL’s request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 8989472948224 bytes), reduce PostgreSQL’s shared memory usage, perhaps by reducing shared_buffers or max_connections.
app[e1baca0d] mia [info] keeper | 2022-11-21 15:34:02.691 UTC [2271] LOG: database system is shut down
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:02.874Z ERROR cmd/keeper.go:1526 failed to start postgres {“error”: “postgres exited unexpectedly”}
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:02.964Z ERROR cmd/keeper.go:719 cannot get configured pg parameters {“error”: “dial unix /tmp/.s.PGSQL.5433: connect: no such file or directory”}
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] sentinel | 2022-11-21T15:34:04.824Z INFO cmd/sentinel.go:995 master db is failed {“db”: “e9c955d4”, “keeper”: “2cc30d1852”}
app[e1baca0d] mia [info] sentinel | 2022-11-21T15:34:04.824Z INFO cmd/sentinel.go:1006 trying to find a new master to replace failed master
app[e1baca0d] mia [info] sentinel | 2022-11-21T15:34:04.825Z ERROR cmd/sentinel.go:1009 no eligible masters
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:05.465Z ERROR cmd/keeper.go:719 cannot get configured pg parameters {“error”: “dial unix /tmp/.s.PGSQL.5433: connect: no such file or directory”}
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] exporter | INFO[0330] Established new database connection to “fdaa:0:ddd8:a7b:2cc3:0:d185:2:5433”. source=“postgres_exporter.go:970”
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] exporter | ERRO[0331] Error opening connection to database (postgresql://flypgadmin:PASSWORD_REMOVED@[fdaa:0:ddd8:a7b:2cc3:0:d185:2]:5433/postgres?sslmode=disable): dial tcp [fdaa:0:ddd8:a7b:2cc3:0:d185:2]:5433: connect: connection refused source=“postgres_exporter.go:1658”
app[e1baca0d] mia [info] checking stolon status
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:07.968Z ERROR cmd/keeper.go:719 cannot get configured pg parameters {“error”: “dial unix /tmp/.s.PGSQL.5433: connect: no such file or directory”}
app[e1baca0d] mia [info] keeper | 2022-11-21T15:34:08.003Z INFO cmd/keeper.go:1504 our db requested role is master
I’ve tried lowering the shared buffers or the max connections, but I always get this in response:
Error can’t get role for fdaa:0:ddd8:a7b:2cc3:0:d185:2: 500: context deadline exceeded
I’ve tried restarting postgres, restarting the app, scaling the app all to no avail. I’m not sure what I should do now to fix the problem.
Thanks for any help you can provide.