Re: [EXTERNAL] Re: Support load balancing in libpq

Поиск
Список
Период
Сортировка
От Jacob Champion
Тема Re: [EXTERNAL] Re: Support load balancing in libpq
Дата
Msg-id CAAWbhmhvkjTN2BxpHFEPsvbi=MKSQ2wZEqwZNwODyRh7ZKcd3A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [EXTERNAL] Re: Support load balancing in libpq  (Maxim Orlov <orlovmg@gmail.com>)
Ответы Re: [EXTERNAL] Re: Support load balancing in libpq  (Jelte Fennema <postgres@jeltef.nl>)
Список pgsql-hackers
On Wed, Sep 14, 2022 at 7:54 AM Maxim Orlov <orlovmg@gmail.com> wrote:
> For the patch itself, I think it is better to use a more precise time function in libpq_prng_init or call it only
once.
> Thought it is a special corner case, imagine all the connection attempts at first second will be seeded with the
save
> value, i.e. will attempt to connect to the same host. I think, this is not we want to achieve.

Just a quick single-issue review, but I agree with Maxim that having
one PRNG, seeded once, would be simpler -- with the tangible benefit
that it would eliminate weird behavior on simultaneous connections
when the client isn't using OpenSSL. (I'm guessing a simple lock on a
global PRNG would be less overhead than the per-connection
strong_random machinery, too, but I have no data to back that up.) The
test seed could then be handled globally as well (envvar?) so that you
don't have to introduce a debug-only option into the connection
string.

Overall, I like the concept.

--Jacob



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Experimenting with Postmaster variable scope
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: document the need to analyze partitioned tables