Skip to content
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

Detect PG configuration difference between 2 servers #283

Open
Krysztophe opened this issue Feb 19, 2021 · 1 comment
Open

Detect PG configuration difference between 2 servers #283

Krysztophe opened this issue Feb 19, 2021 · 1 comment

Comments

@Krysztophe
Copy link
Collaborator

Original use case: configuration was changed on the primary, not copied on the replica. After the restart, the replica does not even start (different max_connections). Or the replica behaves differently than the old primary after a failover.

''settings'' or ''configuration'' services raise alerts when the conf changes or there is something pending, but this is not enough.

Need: a check that raises an alert when the configuration is or will be different on 2 (or more!) servers. These are not always primary/replicas (eg. sharding). Critical could be raised for incoherences preventing a restart (eg. max_connections).

Exclusion/exclusion of parameters would allow some flexibility. Some parameters could be excluded by default (eg. cluster_name, perhaps log_* ?)

Option 1) Compare ''pg_settings'' values. This works only after a ''pg_reload_conf()'', so some configuration can be forgotten . This does not work on a replica which is already down.

Option 2) Get the parameters from postgresql.conf/auto.conf. This is painful due to included files. ''postgres -C'' is very nice for this but need to be provided with the parameter name; AFAIK you cannot get the whole configuration this way. And this needs a filesystem access, some rights, and to define binary & PGDATA paths.

Perhaps is there place for 2 services? compare_active_conf and compare_restart_conf ?

@Krysztophe Krysztophe changed the title Detect configuration difference between 2 servers Detect PG configuration difference between 2 servers Feb 19, 2021
@Krysztophe
Copy link
Collaborator Author

For option 2, pg_file_settings would be helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants