<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">The core problem here is that PGPool wasn’t designed to do what you are trying to do. Now that said, since you specify what commands
 or scripts PGPool calls to execute a failover once it detects a failure of the primary, you can write a script that does NOT execute the promote if the cause is a network partition rather than a primary database failure (although PGPool would still failover
 app connections to what it thinks is the promoted standby database).&nbsp; But the question remains:&nbsp; How would that script know the issue is a network partition rather a failed primary?&nbsp; And at that point, why introduce the overhead and complexity of PGPool at
 all?&nbsp; <o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p>&nbsp;</o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Postgres-BDR &#43; HAProxy would be your best bet, but if you just *<b>want</b>* to use PGPool for some reason, you can
 certainly circumvent everything it does in streaming replication mode to try to make it work for this use case.&nbsp; Instead of streaming replication mode, you might want to look at PGPool built-in replication mode (allows you to write to multiple masters, so
 you could have one in each region). &nbsp;However, I would suspect that incurring that write overhead and latency (particularly over the WAN) is not going to yield very good performance metrics, but it IS more likely to work in your scenario without creating a
 split-brain, versus trying to use PGPool with streaming replication.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p>&nbsp;</o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D">Hope this helps…good luck!<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p>&nbsp;</o:p></span></span></p>
<div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="1086" style="width:407.25pt">
<tbody>
<tr>
<td colspan="3" style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><img width="543" height="70" style="width:5.6562in;height:.7291in" id="Picture_x0020_1" src="cid:image002.png@01D25C63.31391D30" alt="banner2"></span></span><span style="mso-bookmark:_MailEndCompose"><span style="color:#1F497D"><o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
</tr>
<tr style="height:7.5pt">
<td style="padding:0in 0in 0in 0in;height:7.5pt">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:1.0pt;color:#1F497D">&nbsp;<o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
<td style="padding:0in 0in 0in 0in;height:7.5pt"><span style="mso-bookmark:_MailEndCompose"></span></td>
<span style="mso-bookmark:_MailEndCompose"></span>
<td style="padding:0in 0in 0in 0in;height:7.5pt"><span style="mso-bookmark:_MailEndCompose"></span></td>
<span style="mso-bookmark:_MailEndCompose"></span>
</tr>
<tr>
<td nowrap="" valign="top" style="padding:0in 0in 0in .25in">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><b><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666">David Sisk</span></b></span><span style="mso-bookmark:_MailEndCompose"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666">Engineer - Software<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"></span><a href="mailto:dsisk@cisco.com"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666;text-decoration:none">dsisk@cisco.com</span></span></a><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666">Tel:
<o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
<td width="550" valign="top" style="width:206.25pt;padding:0in 0in 0in 15.0pt">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><b><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666">Cisco Systems, Inc.<o:p></o:p></span></b></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#666666">7025-6 Kit Creek Road PO Box 14987<br>
RESEARCH TRIANGLE PARK<br>
27709-4987<br>
United States<br>
cisco.com<o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
<td style="padding:0in 0in 0in 0in"><span style="mso-bookmark:_MailEndCompose"></span></td>
<span style="mso-bookmark:_MailEndCompose"></span>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span lang="EN-GB" style="color:#1F497D;display:none"><o:p>&nbsp;</o:p></span></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="800" style="width:300.0pt">
<tbody>
<tr>
<td style="padding:0in 15.0pt 0in .25in">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#009900"><img border="0" width="18" height="19" style="width:.1875in;height:.1979in" id="Picture_x0020_3" src="cid:image004.png@01D25C63.31391D30" alt="http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif">Think
 before you print.<o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
</tr>
<tr>
<td style="padding:0in 15.0pt 0in .25in">
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#999999">This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use,
 distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#999999">Please
</span></span><a href="http://www.cisco.com/web/about/doing_business/legal/cri/index.html" title="Legal Information"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#0E58A0">click here</span></span><span style="mso-bookmark:_MailEndCompose"></span></a><span style="mso-bookmark:_MailEndCompose"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#999999">
 for Company Registration Information.<o:p></o:p></span></span></p>
</td>
<span style="mso-bookmark:_MailEndCompose"></span>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D"><o:p>&nbsp;</o:p></span></span></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> pgpool-general-bounces@pgpool.net [mailto:pgpool-general-bounces@pgpool.net]
<b>On Behalf Of </b>Yates, James C. -ND<br>
<b>Sent:</b> Wednesday, December 21, 2016 5:12 PM<br>
<b>To:</b> Muhammad Usama &lt;m.usama@gmail.com&gt;<br>
<b>Cc:</b> pgpool-general@pgpool.net<br>
<b>Subject:</b> [pgpool-general: 5191] Re: Architecture Questions<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I would prefer to be in read only mode if the West/East link goes down. The App is opening two connections one for read and one for write. &nbsp;The app will trap any write errors and continue. &nbsp;The East Application Server will connect to the
 first East Database server that it can connect to and depend on PgPool to redirect any write traffic, The same with the West App Servers they would connect to the first West database server that it can connect to. &nbsp;The idea is that we would not fail over across
 regions unless the entire region goes down. &nbsp;<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Dec 21, 2016, at 1:56 PM, Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">On Tue, Dec 20, 2016 at 10:24 PM, Yates, James C. -ND<span class="apple-converted-space">&nbsp;</span>&lt;<a href="mailto:James.C.Yates.-ND@disney.com" target="_blank">James.C.Yates.-ND@disney.com</a>&gt;<span class="apple-converted-space">&nbsp;</span>wrote:<br style="font-variant-caps: normal;orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<br>
</span><o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">What I’m concerned about is the corporate network link between the AWS regions going down and PgPool doing a failover.&nbsp; Then I could have the East and West region both think
 they have a master and doing updates/inserts on each.&nbsp; Then when the link comes back up, my databases are out of sync and I could lose data.&nbsp;<o:p></o:p></span></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">Yes, This is a valid point. Earlier I thought you were concerned about the Watchdog going into the split-brain which is not likely to happen especially in the active-active
 watchdog configurations.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">Unfortunately, I can't think of any perfect solution for backend&nbsp;failover in case of a network partitioning&nbsp;between East and West regions at the moment, Can you please explain
 the availability requirements of your application, Like when the regions are isolated from each other, is it okay as per the requirements that the region that does not have the primary PostgreSQL keeps offline until the link is restored?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">Regards<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Helvetica&quot;,sans-serif">Muhammad Usama<o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>