<div dir="ltr"><div><span style="font-size:12.8px">&gt; Whenever Pgpool-II thinks a backend is being down, there should be a</span><br style="font-size:12.8px"><span style="font-size:12.8px">&gt;log entry in the Pgpool-II log file. Please check.</span><br></div><div><br></div><div>This is the error in the log file when this happens</div><div><br></div><div>2016-11-02 00:00:07: pid 9217: DETAIL:  postmaster on DB node 0 was shutdown by administrative command<br></div><div>2016-11-02 00:00:07: pid 9217: LOG:  received degenerate backend request for node_id: 0 from pid [9217]</div><div>2016-11-02 00:00:07: pid 9188: LOG:  starting degeneration. shutdown host <a href="http://prod1.amazonaws.com">prod1.amazonaws.com</a>(5439)</div><div>2016-11-02 00:00:07: pid 9188: LOG:  Restart all children</div><div><br></div><div>What does &quot;postmaster on DB node 0 was shutdown by administrative command&quot;. I havent sent any shutdown commands to pgpool. I verify connectivity to the cluster whenever this happens and it is always fine. Why does the health check that I configured to run every 30 secs not sense that the cluster is back up again and update the pgpool_status file? Health check details from the log are below</div><div><br></div><div><div>2016-11-01 23:59:54: pid 9188: LOG:  notice_backend_error: called from pgpool main. ignored.</div><div>2016-11-01 23:59:54: pid 9188: WARNING:  child_exit: called from invalid process. ignored.</div><div>2016-11-01 23:59:54: pid 9188: ERROR:  unable to read data from DB node 0</div><div>2016-11-01 23:59:54: pid 9188: DETAIL:  socket read failed with an error &quot;Success&quot;</div></div><div><br></div><div>What dos the above log indicate?</div><div><br></div><div><span style="font-size:12.8px">&gt;Yes, it randomly routes to backends. You can control the possibility</span><br style="font-size:12.8px"><span style="font-size:12.8px">&gt;of the routing.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Is it possible to control routing using round robin approach or least used cluster? If so, where do I configure this?</span></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Thanks,<div>- Manoj</div></div></div></div>
<br><div class="gmail_quote">On Mon, Nov 7, 2016 at 12:08 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">&gt; I have pgpool configured against two redshift backend clusters to do<br>
&gt; parallel writes. Seemingly at random, pgpool determines that one or both<br>
&gt; the clusters are down and stops accepting connections even when they are<br>
&gt; not down. I have health check configured every 30 seconds but that does not<br>
&gt; help as it checks heath and still determines they are down in pgpool_status<br>
&gt; file. How is health status determined and written to the file<br>
&gt; /var/log/pgpool/pgpool_status and why does pgpool think the clusters are<br>
&gt; down when they are not?<br>
<br>
</span>Whenever Pgpool-II thinks a backend is being down, there should be a<br>
log entry in the Pgpool-II log file. Please check.<br>
<span class="gmail-"><br>
&gt; I also tested read query routing and noticed they were being routed<br>
&gt; randomly to the backend clusters. Is there a specific algorithm that pgpool<br>
&gt; uses for read query routing?<br>
<br>
</span>Yes, it randomly routes to backends. You can control the possibility<br>
of the routing.<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; My config parameters are below<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; backend_hostname0 = &#39;cluster1&#39;<br>
&gt;<br>
&gt; backend_port0 = 5439<br>
&gt;<br>
&gt; backend_weight0 = 1<br>
&gt;<br>
&gt; backend_data_directory0 = &#39;/data1&#39;<br>
&gt;<br>
&gt; backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; backend_hostname1 = &#39;cluster2&#39;<br>
&gt;<br>
&gt; backend_port1 = 5439<br>
&gt;<br>
&gt; backend_weight1 = 1<br>
&gt;<br>
&gt; backend_data_directory1 = &#39;/data1&#39;<br>
&gt;<br>
&gt; backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; #-----------------------------<wbr>------------------------------<br>
&gt; -------------------<br>
&gt;<br>
&gt; # HEALTH CHECK<br>
&gt;<br>
&gt; #-----------------------------<wbr>------------------------------<br>
&gt; -------------------<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; health_check_period = 30<br>
&gt;<br>
&gt;                                    # Health check period<br>
&gt;<br>
&gt;                                    # Disabled (0) by default<br>
&gt;<br>
&gt; health_check_timeout = 20<br>
&gt;<br>
&gt;                                    # Health check timeout<br>
&gt;<br>
&gt;                                    # 0 means no timeout<br>
&gt;<br>
&gt; health_check_user = &#39;username&#39;<br>
&gt;<br>
&gt;                                    # Health check user<br>
&gt;<br>
&gt; health_check_password = &#39;password&#39;<br>
&gt;<br>
&gt;                                    # Password for health check user<br>
&gt;<br>
&gt; health_check_max_retries = 10<br>
&gt;<br>
&gt;                                    # Maximum number of times to retry a<br>
&gt; failed health check before giving up.<br>
&gt;<br>
&gt; health_check_retry_delay = 1<br>
&gt;<br>
&gt;                                    # Amount of time to wait (in seconds)<br>
&gt; between retries.<br>
</div></div></blockquote></div><br></div></div>