-
Notifications
You must be signed in to change notification settings - Fork 63
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
[#224] Prefill when doing a switch-to
or primary change.
#226
Conversation
I think I like this direction a bit more. Called the variable |
I would out in an explicit |
See <agroal#226 (comment)>. Do the check of the new primary in the very beginning. Improves also the logs in debug mode to clearly indicate what is going to happen to the old and new server. Close agroal#224
You don't need to enter the https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/pool.c#L848 statement if primary isn't valid, so
|
Can you squash and force push ? |
Ah, there is still a thing. We don't need to call prefill(false) for an old flushed primary server... which is the "if (primary != -1 && ..." check. Otherwise it would try and prefill to |
Just to make it clear, you don't want to prefill at all if the primary is not set or the server has remained the same, right? |
This is only for the There are a lot of cases where |
ea3ac1d
to
0143de9
Compare
I'm not really comfortable with squashing a set of published commits, please check if it is fine now. |
The |
And, you can just do 2 levels
|
Sorry, I'm a little confused: if there is the need to prefill (number of users and limits not zero) we |
Whenever the primary host is changed, by means of an explicit `switch-to` command or by a primary failure, the connection flushing is activated. If possible, the prefill should be also restored on the new server. As suggested in <agroal#225 (comment)> it would be nice to check if the specified new server is the same as the old one (failure of the primary) or a different one (`switch-to`), and in the case they are different the prefill is forced. The prefill will always be to the `INITIAL` size when needed. If the primary is not set, there is no need to prefill with the `MIN_SIZE` value. Close agroal#224
0143de9
to
a6076a6
Compare
There is no need. Hence the |
I have to check something with uncrustify - otherwise I'll merge :) |
Fine.
I was wondering why not to create a function that encapsulates all the above, something like |
Yeah, it could be a |
Merged. Thanks for your contribution ! |
Whenever the primary host is changed, by means of an explicit
switch-to
command or by a primary failure, the connection flushingis activated. If possible, the prefill should be also restored on the
new server.
As suggested in
#225 (comment)
it would be nice to check if the specified new server is the same as
the old one (failure of the primary) or a different one (
switch-to
),and in the case they are different the prefill is forced.