New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL cannot be reloaded in place for routine configuration changes #5915
Comments
We can't really use |
Sure, but I'm wondering if we should provide a reload command to do that anyway. Maybe the official module will still restart by default, but at least users have the option of |
Just to note, what is the current way to overcome this issue.
|
PIng all |
Pinging about what? |
About any new information and status :) |
@danbst
They could be used in two ways
or
In that case user can chose what he wants. We could detect if the file is in nix store or not and based on that we could do "reload". What do you think? Besides that, @ocharles, I think quite a lot of configuration in postgres can be changed inside the database. You can set most of the configuration by running sql commands. Those options which can't be changed there probably require restart anyway (I'm only guessing here), I didn't cover you pg-hba case which would still be valid as external file which chanced. |
I wonder if we can use the |
@spinus @ocharles I've tested my module (heh) and fixed remaining issues. I'll post it here before doing PR, if somebody can test too - I'd be welcome to hear feedback. It doesn't require patching Nixpkgs and is used as a typical module. It requires one PG restart on first switch. Tested on 16.09 Pros: service interface is not changed, your postgresql https://gist.github.com/danbst/382852cae4d93664634e830fa1df4736 |
This doesn't look bad. It might be cleaner to use |
@danbst I would propose to write a test for it :-) |
writing the proper test is blocked by #20886, IMO. I'm very slowly working on this front. Though, I can reuse your PG test, the only change would be add |
closing this in favor for #65296 |
The way we have
services.postgresql
set up currently prohibits in-place reloading (kill HUP
) of postgres, which is doable for a lot of routine configuration changes (e.g., newpg_hba
rules). We've put ourself into a hole by symlinkingpostgresql.conf
at service startup, so just doingnixos-rebuild
withreloadIfChanged = true; restartIfChanged = false;
won't work, because it just reloads the current configuration rather than the new one.One idea would be to re-symlink on reload. Another might be to copy the configuration files around at system activation time.
Thoughts?
The text was updated successfully, but these errors were encountered: