-
Notifications
You must be signed in to change notification settings - Fork 61
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
prefill after switch-to #224
Comments
I agree. |
The problem, at least in my configuration, is when the old server is flushed: https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/pool.c#L852. |
That is likely one way to do it |
I could spend some time and effort on this, if you believe there are no other tricks and dangerous zones... |
Go for it ! |
There is a bit more to it. The old primary should never prefill no matter what the |
I'm going to work on this starting from the next week, but in the meantime I'm reasoning about this. |
In relation to the
Initial
So, I think we agree, right ? |
Yes, it was what I was thinking about. |
👍 |
When a `switch-to` operation is issued, the old server is flushed (i.e., connections are closed) and new connections to the new primary server are established. When such connections are established, the system does a full prefill against the new primary, so that when the `switch-to` completes, the new primary is prefilled as the old one was. Adds also a better detail about the server that is going to be flushed. Close agroal#224
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.
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
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
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
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 <#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 #224
Don't know if this is a valuable feature, but with
1.5
when I do aswitch-to
and/or areset-server
the prefill seems to be dropped.I mean, when I start
pgagroal
the "initial" connections frompgagroal_databases.conf
are established. When I do aswitch-to
to another server, the new server does not get the "initial" connection number but only the "minimum".The same when I come back with another
switch-to
the original server.Is there a reason or should
pgagroal
honor the "initial" connection every time a server is changed as primary?The text was updated successfully, but these errors were encountered: