[Pgpool-general] how to find node role and order of scripts being run
Tatsuo Ishii
ishii at sraoss.co.jp
Wed Oct 5 04:44:18 UTC 2011
>> You can use standard PostgreSQL function pg_is_in_recover() to get the
>> information. It's not necessarily identical to what pgpool-II thinks,
>> but since pgpool-II also uses the function to judge which is which,
>> you could assume that what pg_is_in_recover() returns is what
>> pgpool-II thinks in real world.
>>
>> It would be nice if pcp command returns that info directly though.
>
> Ah, ok, so no way to find out what pgpool thinks internally. Drat!
>
> I ask because I'm trying to troubleshoot some scripts and with 3 active nodes, detaching node 0 causes the system to failover properly to node 1, but if I recover node 0, then detach node 1, the log indicates it can't find a primary node and the failover script eventually gets a -1 as the 'new master node'. I'll try comparing the recovery state to see if that disagrees with what I think is actually happening.
Hum. You'd better to look into PostgreSQL log of node 0 and node 1
carefully. "No new master node found" means that all of nodes returns
pg_is_in_recover() true, which indicates that all of nodes are still
in standby mode, I think.
> How does pgpool use the pg_is_in_recovery() function?
When failover/failback happens, pgpool-II sends pg_is_in_recovery() to
each node to look for a node which returns false. If a node returns
false, it is regarded as primary node.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
More information about the Pgpool-general
mailing list