Re: Libpq support to connect to standby server as priority

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Libpq support to connect to standby server as priority
Дата
Msg-id 28777.1542386147@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Libpq support to connect to standby server as priority  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Libpq support to connect to standby server as priority  (Laurenz Albe <laurenz.albe@cybertec.at>)
Re: Libpq support to connect to standby server as priority  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> Tom Lane wrote:
>> I don't like this patch at all: the business with keeping two connections
>> open seems impossibly fragile and full of race conditions.

> As it is now, the patch doesn't keep two connections open.  It remembers
> the index of the host of the first successful writable connection, but
> closes the connection, and opens another one to that host if no read-only
> host can be found.

Oh!  The reason I assumed it wasn't doing that is that such a behavior
seems completely insane.  If the point is to keep down the load on your
master server, then connecting only to immediately disconnect is not
a friendly way to do that --- even without counting the fact that you
might later come back and connect again.

If that's the best we can do, we should forget the whole feature and
just recommend putting slave servers first in your hosts list when
you want prefer-slave.

            regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pg11.1 jit segv
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: pg11.1 jit segv