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

pgagroal-cli reload added server wrong warn about restart #235

Closed
fluca1978 opened this issue May 12, 2022 · 0 comments · Fixed by #236
Closed

pgagroal-cli reload added server wrong warn about restart #235

fluca1978 opened this issue May 12, 2022 · 0 comments · Fixed by #236
Labels
feature New feature

Comments

@fluca1978
Copy link
Collaborator

Related to #233, when a new server is added to the configuration and the pgagroal-cli reload is issued, the system warns the user about a restart:

INFO  configuration.c:2881 Restart required for Server <spengler>, parameter <host> - Existing  New spengler
INFO  configuration.c:2869 Restart required for Server <spengler>, parameter <port> - Existing 0 New 5432

this is because the restart_server() function gets a new server that cannot be compared to a previous one, since it is added, and thus emits the warning. This is not a real bug, but a misleading message.

@fluca1978 fluca1978 added the feature New feature label May 12, 2022
jesperpedersen pushed a commit that referenced this issue May 12, 2022
The `restart_server()` function checks if two configurations identify
the same server.
When a new server is added, there is no previous configuration to
compare against, and therefore there is no need to emit a restart
warning message between the added server and "nothing".

Close #235
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue May 19, 2022
In order to make calls to `pgagroal_prefill()` consistent around the
code and avoid repetitions, there is a new function named
`pgagroal_prefill_if_can()` that wraps several checks and does the
forking and prefilling.
Therefore there is no need to check against the configuration limits
and users before calling `pgagroal_prefill()` because
`pgagroal_prefill_if_can()` will do by itself.

Also `pgagroal_prefill_if_can()` will check for a primary server, and
in the case there is none, will avoid issuing the prefill at all.

Last, this introduces also the `pgagroal_can_prefill()` function that
is used in turn by `pgagroal_prefill_if_can()` and aims at testing the
configuration for the presence of limits and users. This function can
be used as a condition checker before doing clean-up stuff right
before calling `pgagroal_prefill_if_can()`.

Close agroal#223
jesperpedersen pushed a commit that referenced this issue May 23, 2022
In order to make calls to `pgagroal_prefill()` consistent around the
code and avoid repetitions, there is a new function named
`pgagroal_prefill_if_can()` that wraps several checks and does the
forking and prefilling.
Therefore there is no need to check against the configuration limits
and users before calling `pgagroal_prefill()` because
`pgagroal_prefill_if_can()` will do by itself.

Also `pgagroal_prefill_if_can()` will check for a primary server, and
in the case there is none, will avoid issuing the prefill at all.

Last, this introduces also the `pgagroal_can_prefill()` function that
is used in turn by `pgagroal_prefill_if_can()` and aims at testing the
configuration for the presence of limits and users. This function can
be used as a condition checker before doing clean-up stuff right
before calling `pgagroal_prefill_if_can()`.

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

Successfully merging a pull request may close this issue.

1 participant