| От | Aleksander Alekseev |
|---|---|
| Тема | Re: Patch: Implement failover on libpq connect level. |
| Дата | |
| Msg-id | 20160907143211.GC20001@e733 обсуждение исходный текст |
| Ответ на | Re: Patch: Implement failover on libpq connect level. (Victor Wagner <vitus@wagner.pp.ru>) |
| Список | pgsql-hackers |
> > 8) get_next_element procedure implementation is way too smart (read > > "complicated"). You could probably just store current list length and > > generate a random number between 0 and length-1. > > 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. Great! In this case I would be _trivial_ for you to write a comment that describes how this procedure works, what makes you think that it gives a good distribution in all possible cases (e.g. if there is more than 0x10000 elements in a list - why not), etc. Right? :) -- Best regards, Aleksander Alekseev
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера