Re: Proposal: Implement failover on libpq connect level.

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Proposal: Implement failover on libpq connect level.
Дата
Msg-id 8cebcc80-6d93-47e2-8168-4dc9e4d08bad@mm
обсуждение исходный текст
Ответ на Re: Proposal: Implement failover on libpq connect level.  (''Victor Wagner *EXTERN*' *EXTERN*' <vitus@wagner.pp.ru>)
Ответы Re: Proposal: Implement failover on libpq connect level.  (Victor Wagner <vitus@wagner.pp.ru>)
Список pgsql-hackers
    Victor Wagner wrote:

> It would just take a bit more time for client and a bit more load for
> server - to make sure that this connection is read-write by
> issuing
>
>    show transaction_read_only
>
> statement before considering connection useful.

If the purpose of the feature is to wait for a failover to complete,
shouldn't it check for pg_is_in_recovery() rather than transaction_read_only ?

That's because a database or user can be made read-only-on-connect
on an otherwise read-write instance by issuing ALTER DATABASE dbname SET default_transaction_read_only TO on;
The same for a user with ALTER USER.

In that case,  transaction_read_only  would be OFF after connecting,
both on the master and on a slave, independantly of any failover
in progress or finished or not having occurred at all.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Freeze avoidance of very large table.
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: WIP: Access method extendability