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

restart required always for any limit change? #359

Closed
fluca1978 opened this issue Mar 27, 2023 · 1 comment
Closed

restart required always for any limit change? #359

fluca1978 opened this issue Mar 27, 2023 · 1 comment

Comments

@fluca1978
Copy link
Collaborator

While working on #329 I noted that the function restart_limit notifies that a restart is required pretty much everytime a single limit changes: https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/configuration.c#L2843.
I think we could maybe relax a little this, for example, assuming the same limit entry, a restart could not be required if:

  • e.max_size < n.max_size
    or
  • e.min_size < n.min_size && n.min_size <= e.initial_size

that means we can handle increasing of the max_size, since we don't have (yet) connections and we can allow min_size to grow up to initial_size (if set).

This should be safe because pgagroal_reload_configuration calls a pass to pgagroal_validate_configuration, so in the case the limits have changed in a way that is not applicable, e.g., max_size greater than the total number of connections, the validation phase should catch it and a restart/reconfiguration would be required anyway.

@fluca1978
Copy link
Collaborator Author

Rethink a little about this, probably only the e.max_size < n.max_size could not trigger a restart, because for min_size it would be better to check about established connections, so it should be something like e.min_size < n.min_size && n.min_size < e.initial_size && n.min_size < current_connections.

In other words, it looks to me something it is not worth investing at this moment.

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

1 participant