<div dir="ltr">Hi Usama / Tatsuo,<div><br></div><div>         Received the email notification today, sorry for the delayed response. </div><div>Please find attached the pgpool-II log for the same.</div><div><br></div><div>So basically below is the short summary of the issue:</div><div><br></div><div><br></div><div>Node -1 : Pgpool Master + Postgres Master<br></div><div><br></div><div>Node -2 : Pgpool Standby + Postgres Standby</div><div><br></div><div>Node-3 : Pgpool Standby + Postgres Standby</div><div><br></div><div><br></div><div>When network failure happens and Node-1 goes out of network, below is the status :</div><div><br></div><div>Node-1 : Pgpool Lost status + Postgres Standby (down)</div><div><br></div><div>Node -2 : Pgpool Master + Postgres Master</div><div><br></div><div>Node-3 : Pgpool Standby + Postgres Standby</div><div><br></div><div><br></div><div>Now when Node-1 comes back to network , below is the status causing the pgpool cluster to get into imbalance :</div><div><br></div><div><br></div><div><br></div><div>lcm-34-189:~ # psql -h 10.198.34.191 -p 9999 -U pgpool postgres -c &quot;show pool_nodes&quot;<br>Password for user pgpool:<br> node_id |   hostname    | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | last_status_change<br>---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------<br> 0       | 10.198.34.188 | 5432 | up     | 0.333333  | primary | 0          | true              | 0                 | 2019-08-31 16:40:26<br> 1       | 10.198.34.189 | 5432 | up     | 0.333333  | standby | 0          | false             | 1013552           | 2019-08-31 16:40:26<br> 2       | 10.198.34.190 | 5432 | up     | 0.333333  | standby | 0          | false             | 0                 | 2019-08-31 16:40:26<br>(3 rows)<br></div><div><br></div><div>lcm-34-189:~ # /usr/local/bin/pcp_watchdog_info -p 9898 -h 10.198.34.191 -U pgpool<br>Password:<br>3 NO lcm-34-188.dev.lcm.local:9999 Linux lcm-34-188.dev.lcm.local 10.198.34.188<br><br>lcm-34-189.dev.lcm.local:9999 Linux lcm-34-189.dev.lcm.local lcm-34-189.dev.lcm.local 9999 9000 7 STANDBY<br>lcm-34-188.dev.lcm.local:9999 Linux lcm-34-188.dev.lcm.local 10.198.34.188 9999 9000 4 MASTER<br>lcm-34-190.dev.lcm.local:9999 Linux lcm-34-190.dev.lcm.local 10.198.34.190 9999 9000 4 MASTER<br>lcm-34-189:~ #<br></div><div><br></div><div><br></div><div><br></div><div>Thanks And Regards,</div><div><br></div><div>   Lakshmi Y M</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 20, 2019 at 8:55 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; On Sat, Aug 17, 2019 at 12:28 PM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt; <br>
&gt;&gt; &gt; Hi Pgpool Team,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;               *We are nearing a production release and running into the<br>
&gt;&gt; &gt; below issues.*<br>
&gt;&gt; &gt; Replies at the earliest would be highly helpful and greatly appreciated.<br>
&gt;&gt; &gt; Please let us know on how to get rid of the below issues.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We have a 3 node pgpool + postgres cluster - M1 , M2, M3. The pgpool.conf<br>
&gt;&gt; &gt; is as attached.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *Case I :  *<br>
&gt;&gt; &gt; M1 - Pgpool Master + Postgres Master<br>
&gt;&gt; &gt; M2 , M3 - Pgpool slave + Postgres slave<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; - M1 goes out of network. its marked as LOST in the pgpool cluster<br>
&gt;&gt; &gt; - M2 becomes postgres master<br>
&gt;&gt; &gt; - M3 becomes pgpool master.<br>
&gt;&gt; &gt; - When M1 comes back to the network, pgpool is able to solve split brain.<br>
&gt;&gt; &gt; However, its changing the postgres master back to M1 by logging a<br>
&gt;&gt; statement<br>
&gt;&gt; &gt; - &quot;LOG:  primary node was chenged after the sync from new master&quot;, so<br>
&gt;&gt; since<br>
&gt;&gt; &gt; M2 was already postgres master (and its trigger file is not touched) its<br>
&gt;&gt; &gt; not able to sync to the new master.<br>
&gt;&gt; &gt; *I somehow want to avoid this postgres master change..please let us know<br>
&gt;&gt; if<br>
&gt;&gt; &gt; there is a way to avoid it*<br>
&gt;&gt;<br>
&gt;&gt; Sorry but I don&#39;t know how to prevent this. Probably when former<br>
&gt;&gt; watchdog master recovers from an network outage and there&#39;s already<br>
&gt;&gt; PostgreSQL primary server, the watchdog master should not sync the<br>
&gt;&gt; state. What do you think Usama?<br>
&gt;&gt;<br>
&gt; <br>
&gt; Yes, that&#39;s true, there is no functionality that exists in Pgpool-II to<br>
&gt; disable the backend node status synch. In fact that<br>
&gt; would be hazardous if we somehow disable the node status syncing.<br>
&gt; <br>
&gt; But having said that, In the mentioned scenario when the M1 comes back and<br>
&gt; join the watchdog cluster Pgpool-II should have<br>
&gt; kept the M2 as the true master while resolving the split-brain. The<br>
&gt; algorithm used to resolve the true master considers quite a<br>
&gt; few parameters and for the scenario, you explained, M2 should have kept the<br>
&gt; master node status while M1 should have resigned<br>
&gt; after joining back the cluster and effectively the M1 node should have been<br>
&gt; syncing the status from M2 ( keeping the proper primary node)<br>
&gt; not the other way around.<br>
&gt; Can you please share the Pgpool-II log files so that I can have a look at<br>
&gt; what went wrong in this case.<br>
<br>
Usama,<br>
<br>
Ok, the scenario (PostgreSQL primary x 2 in the end) should have not<br>
happend. That&#39;s a good news.<br>
<br>
Lakshmi,<br>
<br>
Can you please provide the Pgpool-II log files as Usama requested?<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div>