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

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: itagaki(dot)takahiro(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to reliably detect if it's a promoting standby
Date: 2010-10-14 15:17:01
Message-ID: 20101015.001701.597966886238392734.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Thu, Oct 14, 2010 at 11:10 AM, Tatsuo Ishii <ishii(at)postgresql(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2010-10-14 15:24:17 Re: [HACKERS] Docs for archive_cleanup_command are poor
Previous Message Mike Fowler 2010-10-14 15:11:30 Re: First patch proposal