<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">I&#39;m in charge of setting up a highly-available Postgres database. &nbsp;To do this, I&#39;ve set up master-standby nodes behind two master-master PgPool instances with watchdog enabled, distributed across multiple datacenters. &nbsp;Here&#39;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: &nbsp;PgPool A ---- Postgres master</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;\/</font></div>

<div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;/\</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">Datacenter B: &nbsp;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&#39;s a glaring problem: &nbsp;split-brain. &nbsp;Let&#39;s say either datacenter loses internet connectivity. &nbsp;PgPool B will promote the standby, thinking the master is down. &nbsp;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. &nbsp;However, this isn&#39;t an available option. &nbsp;I could emulate VIP by updating the configuration of the clients to point to the new PgPool. &nbsp;However, this would be fruitless: &nbsp;If PgPool B can&#39;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. &nbsp;Can anybody share some insight?</div>

<div><div><br></div><div>&mdash; Theron</div></div>
</div>