fly-apps / postgres-ha

Postgres + Stolon for HA clusters as Fly apps.
Apache License 2.0
318 stars 131 forks source link

Postgres config changes not being applied #96

Open samuelbalogh opened 1 year ago

samuelbalogh commented 1 year ago

Details

I would like to update the log-statement config variable to all. However, I am unable to do so with flyctl as the value remains unchanged.

 🍰   fly postgres config view
NAME                            VALUE   UNIT    DESCRIPTION                                                                                     PENDING RESTART
log-min-duration-statement      -1      ms      Sets the minimum execution time above which all statements will be logged. (-1, 2147483647)     false
log-statement                   none            Sets the type of statements logged. [none, ddl, mod, all]                                       false
max-connections                 300             Sets the maximum number of concurrent connections. (1, 262143)                                  false
shared-buffers                  8192    8kB     Sets the number of shared memory buffers used by the server. (16, 1073741823)                   false
shared-preload-libraries                        Lists shared libraries to preload into server.                                                  false
wal-level                       replica         Sets the level of information written to the WAL. [minimal, replica, logical]                   false

 🍰   fly postgres config update --log-statement all
NAME            VALUE   TARGET VALUE    RESTART REQUIRED
log-statement   none    all             false

? Are you sure you want to apply these changes? Yes
Performing update...
Update complete!
 🍰   fly postgres config view
NAME                            VALUE   UNIT    DESCRIPTION                                                                                     PENDING RESTART
log-min-duration-statement      -1      ms      Sets the minimum execution time above which all statements will be logged. (-1, 2147483647)     false
log-statement                   none            Sets the type of statements logged. [none, ddl, mod, all]                                       false
max-connections                 300             Sets the maximum number of concurrent connections. (1, 262143)                                  false
shared-buffers                  8192    8kB     Sets the number of shared memory buffers used by the server. (16, 1073741823)                   false
shared-preload-libraries                        Lists shared libraries to preload into server.                                                  false
wal-level                       replica         Sets the level of information written to the WAL. [minimal, replica, logical]                   false

Flyctl version

🍰   fly version
flyctl v0.0.443 linux/amd64 Commit: 63f03d09 BuildDate: 2023-01-05T21:09:40Z

OS

Ubuntu 20.04 on WSL2.

rugwirobaker commented 1 year ago

There we had introduced a bug in the flyctl pg config update command but that should be fixed in the latest release: https://github.com/superfly/flyctl/releases/tag/v0.0.444

samuelbalogh commented 1 year ago

Thanks @rugwirobaker for the quick reply. I confirm that the config update works now πŸ’ͺ .

Minor issue is that after the update command I get an error message (even though the update was successful).

? Are you sure you want to apply these changes? Yes
Performing update...
Error unexpected end of JSON input
rugwirobaker commented 1 year ago

Great catch, I'll look into it.

davissp14 commented 1 year ago

That error should go away once this feature is transitioned to run over http.