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

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: How to reliably detect if it's a promoting standby
Дата
Msg-id 20101020.233201.856152966586118390.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: How to reliably detect if it's a promoting standby  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Ответы Re: How to reliably detect if it's a promoting standby  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
>> 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!

*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
***************
*** 5604,5610 **** GetLatestXTime(void) Datum pg_is_in_recovery(PG_FUNCTION_ARGS) {
!     PG_RETURN_BOOL(RecoveryInProgress()); }  /*
--- 5604,5613 ---- 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); }  /*


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_rawdump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Extensions, this time with a patch