Re: Patch: Implement failover on libpq connect level.
От | Mithun Cy |
---|---|
Тема | Re: Patch: Implement failover on libpq connect level. |
Дата | |
Msg-id | CAD__Oui5DGk1oJnhPNCd_+4WNKgJTb2ni44k3urxxO+s5esw2A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Patch: Implement failover on libpq connect level. (Victor Wagner <vitus@wagner.pp.ru>) |
Ответы |
Re: Patch: Implement failover on libpq connect level.
|
Список | pgsql-hackers |
On Wed, Sep 7, 2016 at 7:26 PM, Victor Wagner <vitus@wagner.pp.ru> wrote:
> No, algorithm here is more complicated. It must ensure that there would
> not be second attempt to connect to host, for which unsuccessful
> connection attempt was done. So, there is list rearrangement.
>Algorithm for pick random list element by single pass is quite trivial.
If concern is only about excluding address which was tried previously. Then I think we can try this way, randomly permute given address list (for example fisher-yates shuffle) before trying any of those address in it. After that you can treat the new list exactly like we do for sequential connections. I think this makes code less complex.
-- В списке pgsql-hackers по дате отправления: