<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">I'm in charge of setting up a highly-available Postgres database.  To do this, I've set up master-standby nodes behind two master-master PgPool instances with watchdog enabled, distributed across multiple datacenters.  Here's an illustration of what this looks like:</span><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">Datacenter A:  PgPool A ---- Postgres master</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">                  |      \/</font></div>

<div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">                  |      /\</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">Datacenter B:  PgPool B ---- Postgres standby</font></div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">But there's a glaring problem:  split-brain.  Let's say either datacenter loses internet connectivity.  PgPool B will promote the standby, thinking the master is down.  PgPool A will continue to send queries to the old master, not aware that the standby was promoted, since PgPool B was not able to communicate the promotion to A.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Virtual IP, I believe, is supposed to help with problem, by allowing for only a single PgPool master.  However, this isn't an available option.  I could emulate VIP by updating the configuration of the clients to point to the new PgPool.  However, this would be fruitless:  If PgPool B can't communicate with PgPool A, it very well may not be able to communicate with a client in the same datacenter as PgPool A.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">This seems like a very difficult problem to solve, but it cannot be an uncommon one.  Can anybody share some insight?</div>

<div><div><br></div><div>— Theron</div></div>
</div>