<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have some clients who are currently using <span class="">pcp_promote_node</span> with DISALLOW_TO_FAILOVER.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">They have a two <span class="">node</span> PostgreSQL cluster which is managed by EnterpriseDB&#39;s PPFM (Postgres Plus Failover Manager). This is a requirement.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">When a failover happens and PPFM promotes the new slave it fences the old master with the <span class="">pcp_promote_node</span>command.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">This is desirable because</div><div style="font-family:arial,sans-serif;font-size:13px"><ol><li style="margin-left:15px">
It detaches the old master</li><li style="margin-left:15px">It promotes the promotion target to master </li><li style="margin-left:15px">It does not block while searching for the new master (as would occur with pcp_detach_node)</li>
</ol><div>After <span class="">pcp_promote_node</span> is called, the PostgreSQL failover occurs. This does mean a short period in which the pgpool master is not promoted, but this seems to be tolerated by the software.</div>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Cheers,</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div style="color:#b8276a;font:bold 14px Arial,Helvetica,sans-serif">

        <br>
        <span style="color:#323b62">James Sewell,</span><br>
        <span style="color:#a9a9a9"><span style="font:12px Arial,Helvetica,sans-serif">PostgreSQL Team Lead / Solutions Architect </span></span><br>
        <span style="color:#a9a9a9">______________________________________</span><br>
         </div>
<img alt="" src="http://www.lisasoft.com/sites/lisasoft/files/u1/logo1.jpg" style="margin:0px;width:153px;height:50px"><br>
<div style="font:normal 12px/20px Arial,Helvetica,sans-serif;color:#404040;margin:0">
        <span style="color:#a9a9a9">Level 2, 50 Queen St, Melbourne VIC 3000</span><br>
        <br>
        <strong>P </strong><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8000</span></span><span style="color:rgb(169,169,169)"> </span><strong> </strong><span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>W</strong></span></span> <a style="color:rgb(64,64,64);margin:2px 0px;text-decoration:none"><span style="color:#a9a9a9">www.lisasoft.com</span></a>  <span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>F </strong></span></span><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8099</span></span></div>

<div style="padding-top:8px">
         </div></div>
<br><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 4:54 PM, Yugo Nagata <span dir="ltr">&lt;<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Are you using pcp_promote_node? If so, please tell me your usecase!<br>
<br>
pgpool-II has pcp_promote_node command, which change specified backend<br>
nodes status to &#39;primary&#39;, but this has some problems.<br>
So, if there is no users of pcp_promote_node, we consider to remove<br>
this from pgpool-II. Or not, I want to know usecases and fix<br>
pcp_promote_node to be more usefull and suitable for the usecase.<br>
<br>
The current pcp_promote_node works as below;<br>
<br>
(0) This is enabled only in master-slave / streaming-replication mode.<br>
<br>
(1) This changes pgpool-II&#39;s internal status and set the specified<br>
    node to primary. The internal status is used in online-recovery<br>
    and loadbalancing etc..<br>
** Note that this doesn&#39;t control the backend nodes themselves.**<br>
<br>
(2) All nodes other than the new primary are detached from pgpool-II.<br>
<br>
(3) pgpool-II execute follow_master command for all the detached nodes.<br>
    follow_master command is mainly used for auto-recovery of standbys<br>
    from the new primary.<br>
<br>
Here, I found the some problems:<br>
<br>
(a) Even when DISALLOW_TO_FAILOVER is used, backends node are detached<br>
    at step (2).<br>
(b) If pcp_recovery_node is executed in follow_master command at step (3),<br>
    recovery can fail because pgpool-II&#39;s internal status can be different<br>
    from the acutual backend status of primary/standby.<br>
<br>
I want to fix about (a), if there is any user of pcp_promote_node.<br>
I think the design would be:<br>
 - When DISALLOW_TO_FAILOVER is used, pcp_promote_node is disabled<br>
   because this command can detach some backend nodes.<br>
 - or, pcp_promote_node change primary node status, but doesn&#39;t detach<br>
   any nodes. (In this case, some trick would be required so that<br>
   primary node should be unique.)<br>
<br>
About (b), I think this is a restriction of pgpool-II. User have<br>
to note that internal status can be different from the acutual backend<br>
status of primary/standby, after using pcp_promote_node. If you know<br>
other idea, please tell me.<br>
<br>
Any comment and suggestion?<br>
<br>
<br>
Best regards,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt;<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</font></span></blockquote></div><br></div>

<br>
<p><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14.545454025268555px;background-color:rgb(255,255,255)"><hr><font size="1" color="Gray" face="Arial">The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.</font></div></p>