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

2010-10-21 Thread Dimitri Fontaine
Heikki Linnakangas writes: > On 20.10.2010 18:06, Tatsuo Ishii wrote: >> Apart this, I wonder why walsender/walreceiver do not transfer archive >> logs as well. > > What do you mean? I'd be pleased if Tatsuo idea have anything to do with this mail: http://archives.postgresql.org/message-id/m23

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

2010-10-20 Thread Heikki Linnakangas
On 20.10.2010 18:06, Tatsuo Ishii wrote: 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. Apart this, I wonder why walsender/walreceiver do not transfer archive logs as well. What

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

2010-10-20 Thread Tatsuo Ishii
> 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. Apart this, I wonder why walsender/walreceiver do not transfer archive logs as well. -- Tatsuo Ishii SRA OSS, Inc. Japan English:

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

2010-10-20 Thread Robert Haas
On Wed, Oct 20, 2010 at 10:35 AM, Heikki Linnakangas 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

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

2010-10-20 Thread Heikki Linnakangas
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

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

2010-10-20 Thread Tatsuo Ishii
>> 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

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

2010-10-16 Thread Tatsuo Ishii
> On Thu, Oct 14, 2010 at 7:35 PM, Tatsuo Ishii wrote: >>> What new public interfaces do you think are needed for 9.1 in this >>> regard? >> >> At this point I'm thinking of modifying existing pg_is_in_recovery(), >> thus 0 new public interface. > > pg_is_in_recovery() returns a bool, are you pro

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

2010-10-15 Thread Jaime Casanova
On Thu, Oct 14, 2010 at 7:35 PM, Tatsuo Ishii wrote: >> What new public interfaces do you think are needed for 9.1 in this >> regard? > > At this point I'm thinking of modifying existing pg_is_in_recovery(), > thus 0 new public interface. pg_is_in_recovery() returns a bool, are you proposing to c

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

2010-10-14 Thread Tatsuo Ishii
> What new public interfaces do you think are needed for 9.1 in this > regard? At this point I'm thinking of modifying existing pg_is_in_recovery(), thus 0 new public interface. The heart of the function is RecoveryInProgress(). It simply returns LocalRecoveryInProgress. In addition to that, check

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

2010-10-14 Thread David Fetter
What new public interfaces do you think are needed for 9.1 in this regard? Cheers, David. On Thu, Oct 14, 2010 at 11:10:14AM +0900, Tatsuo Ishii 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 t

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

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

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

2010-10-14 Thread Itagaki Takahiro
On Thu, Oct 14, 2010 at 11:10 AM, Tatsuo Ishii 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 :-) -- Ita

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

2010-10-14 Thread Tatsuo Ishii
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. -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese: http://www.sraoss.co.jp > H

[HACKERS] How to reliably detect if it's a promoting standby

2010-10-13 Thread Tatsuo Ishii
Hi, I'm looking for a way to reliably detect if it's a promoting standby. This is neccessary for pgpool-II manage streaming replication clusters. When primary goes down, standby *could* start promoting to primary. The only way to find it is calling pg_is_in_recovery(). Problem is, it returns true