Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.

Поиск
Список
Период
Сортировка
От Elvis Pranskevichus
Тема Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.
Дата
Msg-id 1572601.d6Y6hSXNBC@hammer.magicstack.net
обсуждение исходный текст
Ответ на Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby"GUC pseudo-variable.  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Ответы Re: [HACKERS] [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On Wednesday, May 24, 2017 9:38:36 PM EDT Tsunakawa, Takayuki wrote:
> The clients will know the change of session_read_only when they do
> something that calls RecoveryInProgress().  Currently,
> RecoveryInProgress() seems to be the only place where the sessions
> notice the promotion, so I set session_read_only to the value of
> default_transaction_read_only there.  I think that there is room for
> discussion here.  It would be ideal for the sessions to notice the
> server promotion promptly and notify the clients of the change.  I
> have no idea to do that well.

My original patch did that via the new SendSignalToAllBackends() helper,
which is called whenever the postmaster exits hot stanby.

I incorporated those bits into your patch and rebased in onto master.  
Please see attached.

FWIW, I think that mixing the standby status and the default 
transaction writability is suboptimal.  They are related, yes, but not 
the same thing.  It is possible to have a master cluster in the 
read-only mode, and with this patch it would be impossible to 
distinguish from a hot-standby replica without also polling 
pg_is_in_recovery(), which defeats the purpose of having to do no
database roundtrips.  

                                 Elvis

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Arseny Sher
Дата:
Сообщение: Re: [HACKERS] DROP SUBSCRIPTION hangs if sub is disabled in the same transaction
Следующее
От: Sokolov Yura
Дата:
Сообщение: Re: [HACKERS] Small improvement to compactify_tuples