Re: How to reliably detect if it's a promoting standby
От | Robert Haas |
---|---|
Тема | Re: How to reliably detect if it's a promoting standby |
Дата | |
Msg-id | AANLkTikg50D6PgzLbwgDvgBx110inT66q47d8BgJ+cDR@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: How to reliably detect if it's a promoting standby (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
Список | pgsql-hackers |
On Wed, Oct 20, 2010 at 10:35 AM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > 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. I think what we need is a second function, not a change to the definition of this one. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: