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

[enhancement] show warning if set postgresql paremeters in patroni config #943

Closed
combrs opened this issue Jan 24, 2019 · 0 comments
Closed

Comments

@combrs
Copy link

combrs commented Jan 24, 2019

I have a setup with consul, patroni and postgres latest versions as of now.

I try to edit-config to set postgres parameters like work_mem, but it not applied to postgres. It apply to DCS config in consul successfully, wrote to patroni.dynamic.json, but silently ignored by patroni with message "INFO: No PostgreSQL configuration items changed, nothing to reload."
I think there was a bug in patroni-consul integration, but after investigations and reading examples I found root cause: I wrote postgres parameters on wrong level of yaml.
My first try:

postgresql:
  maintenance_work_mem: 128MB
  max_connections: 150

It is ignored.

Right config:

postgresql:
  parameters:
    maintenance_work_mem: 96MB
    max_connections: '101'

Because you know patroni parameters that can appear at "postgresql" section (like 'use_pg_rewind') and 'max_connections' (parameters from postgresql own config) not among them, you may issue WARNING message in log, show some warn in patronictl interface, or similar.

Like "Please move aaa, bbb options to 'parameters' section, otherwise it will be ignored by patroni!"

Now I have a config like this:

# consul kv get service/postgres/config

{"maximum_lag_on_failover": 1048576, "retry_timeout": 10, "postgresql": {"use_slots": true, 
"use_pg_rewind": true, "parameters": {"maintenance_work_mem": "96MB", "max_connections": "101"},
 "work_mem": "8Mb", "maintenance_work_mem": "128MB", "max_connections": 150}, "loop_wait": 10, 
"ttl": 50}

With parameters doubled in different sections, and it silently accepted without any warning, I think it is wrong. (tough to figure for human which parameter are actual).

This issue related to #929 ,maybe.

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

No branches or pull requests

2 participants