[Pgpool-general] Two primary servers

Tatsuo Ishii ishii at sraoss.co.jp
Thu Aug 11 01:07:34 UTC 2011


> Hi pgpool experts, I am just experiencing with the 3.1alpha and having this case where I am not sure if it is the expected behavior.
> I set up pgpool and a postgres 9.0.2 on one box and another postgres 9.0.2 on another box. I have also configured the pgpooladmin to work with them. On initial start, pgpool chooses the one with smaller id as primary and the other as standby. If I disconnect the primary via the PHP page, failover kicks in and makes the second box primary. But in the status, for the old primary, it still says "Down Running as primary server". Now try to bring the the connection back by clicking the 'Return' button, I get two primary servers. Please note that the old primary wasn't actually shutdown physically. Is this an expected case?

Yeah, I noticed the behavior. Having two primary nodes is not good of
course (called "split brain"). One idea is modifying pcp_attache_node
(called from pgpoolAdmin when you click 'Return' button) to check:

1) Check if a primary server already exists.
2) If it does, check if the target node is another primary server or not.
3) If the target node is another primary server, throw an error.

Better idea, comments?
--
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