Re: How to reliably detect if it's a promoting standby - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: How to reliably detect if it's a promoting standby
Date
Msg-id 20101015.001701.597966886238392734.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: How to reliably detect if it's a promoting standby  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
List pgsql-hackers
> On Thu, Oct 14, 2010 at 11:10 AM, Tatsuo Ishii <ishii@postgresql.org> wrote:
>> Ok, it seems impossible to do that by using any public interfaces
>> currently available in PostgreSQL 9.0. I will create a custom C
>> function to be distributed along with pgpool-II.
> 
> Could you submit the function for 9.1? Thanks :-)

I can't wait till 9.1 since pgpool-II needs it now. Of course I could
propose a patch against HEAD when I have enough time...

BTW, I have checked xlog.c etc. and probably the only way to know if
the standby is promoting is, to see if ShutdownWalRcv() is called. If
it's called, global variable WalRcvData->walRcvsState is set to other
than WALRCV_RUNNING, I think.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: SQL command to edit postgresql.conf, with comments
Next
From: Brendan Jurd
Date:
Subject: Re: Docs for archive_cleanup_command are poor