[pgpool-general: 3110] Re: Possible split-brain scenario

Tatsuo Ishii ishii at postgresql.org
Thu Aug 21 07:38:49 JST 2014

> Arrigato, Ishii-San,
> Sent from my iPad
> On Aug 19, 2014, at 7:26 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>> I'm trying to figure out if pgpool can avoid a split-brain scenario. Say my
>>> primary server loses internet connectivity including with both my standbys, but
>>> those standbys are still happily communicating with each other and with the
>>> network. In that event, I would expect the first standby to promote itself to
>>> become the new master and the second standby would start following it. I've
>>> actually seen this work here. But, what happens to the original primary in the
>>> event that network connectivity is restored? Unless it is demoted to become a
>>> standby to the new primary, which in fact may not succeed, then I have a
>>> split-brain situation. Would pgpool degenerate the old primary on reconnection?
>>> I'm trying to figure out which pgpool would now have control of the overall
>>> system: the one on the old primary or the one on the new primary?
>> In this case old primary is treated as "down" state by pgpool and
>> pgpool does not route any request to the down node. So as long as
>> clients connect to pgpool to use PostgreSQL, there should be no
>> problem (no split brain). Of course if a client connects to the old
>> primary directly (not via pgpool), that will be a problem but it's
>> user's fault.
> If this is so, what would cause the primary to bring down the VIP which by now the newly promoted primary would have assumed? If it doesn't do so, then an IP conflict would be present on the network. And Is there a way to have pgpool run a command script which would attempt to turn the old primary into a new standby for the newly promoted primary? (Place or build a recovery.conf file, for instance.) If so, I would assume that pgpool could then put the old primary back into service. Although that might still fail depending on how long the old server was incommunicado.

Wao. I thought you were talking about PostgreSQL streaming replication
"primary". Actually you were talking about watchdog "primary".

Probably Yugo has better idea about your concern. Yougo?

Best regards,
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php

More information about the pgpool-general mailing list