Re: How to reliably detect if it's a promoting standby

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: How to reliably detect if it's a promoting standby
Дата
Msg-id 4CBEFE1B.7050505@enterprisedb.com
обсуждение исходный текст
Ответ на Re: How to reliably detect if it's a promoting standby  (Tatsuo Ishii <ishii@postgresql.org>)
Ответы Re: How to reliably detect if it's a promoting standby  (Robert Haas <robertmhaas@gmail.com>)
Re: How to reliably detect if it's a promoting standby  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
On 20.10.2010 17:32, Tatsuo Ishii wrote:
>>> pg_is_in_recovery() returns a bool, are you proposing to change that?
>>
>> No. I just thought about adding more condition when it returns true.
>
> Here is the patch. Comments are welcome!
>...
>    Datum
>    pg_is_in_recovery(PG_FUNCTION_ARGS)
>    {
> !     /* use volatile pointer to prevent code rearrangement */
> !     volatile WalRcvData *walrcv = WalRcv;
> !
> !     PG_RETURN_BOOL(RecoveryInProgress()&&  walrcv->walRcvState == WALRCV_RUNNING);
>    }
>

This returns 'false' if you're in hot standby mode running against an 
archive. That seems wrong, I don't think the walreceiver state should 
play any role in this.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: max_wal_senders must die
Следующее
От: Tom Lane
Дата:
Сообщение: Re: max_wal_senders must die