<div dir="ltr"><div><div>Jan,<br><br></div>You are right. Tweaking the tcp keep alive parameters helped.<br><br></div>Now slon.conf contains:<br><div><pre class="">tcp_keepalive=<span class="">true</span>
tcp_keepalive_interval=45
tcp_keepalive_count=20
tcp_keepalive_idle=30
cleanup_interval=30<br><br></pre><pre class="">Thanks a lot for the timely response.<br><br>- Sridevi<br></pre></div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 11:46 PM, Jan Wieck <span dir="ltr">&lt;<a href="mailto:JanWieck@yahoo.com" target="_blank">JanWieck@yahoo.com</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"><div class="im">On 06/13/13 06:25, Sridevi R wrote:<br>
&gt; Hello Jan,<br>
&gt;<br>
&gt; The Master and Slave DBs talk through a firewall.<br>
&gt; VIP IPs and SNAT IPs are used in pg_hba.conf.<br>
&gt;<br>
&gt; The corresponding messages in the postgres server log:<br>
&gt;<br>
&gt; 2013-06-13 09:46:21.224 GMT,,,6630,&quot;<a href="http://10.4.2.2:42031" target="_blank">10.4.2.2:42031</a><br>
</div>&gt; &lt;<a href="http://10.4.2.2:42031" target="_blank">http://10.4.2.2:42031</a>&gt;&quot;,51b994ed.19e6,1,&quot;&quot;,2013-06-13 09:46:21<br>
<div><div class="h5">&gt; GMT,,0,LOG,08P01,&quot;incomplete startup packet&quot;,,,,,,,,,&quot;&quot;<br>
&gt; 2013-06-13 09:57:38.596 GMT,&quot;postgres&quot;,&quot;db01&quot;,6634,&quot;&lt;ip address printed<br>
&gt; here&gt;:53924&quot;,51b994f7.19ea,1,&quot;idle&quot;,2013-06-13 09:46:31<br>
&gt; GMT,28/0,0,LOG,08006,&quot;could not receive data from client: Connection<br>
&gt; reset by peer&quot;,,,,,,,,,&quot;slon.node_1_listen&quot;<br>
&gt; 2013-06-13 09:57:38.596 GMT,&quot;postgres&quot;,&quot;db01&quot;,6634,&quot;&lt;ip address printed<br>
&gt; here&gt;:53924&quot;,51b994f7.19ea,2,&quot;idle&quot;,2013-06-13 09:46:31<br>
&gt; GMT,28/0,0,LOG,08P01,&quot;unexpected EOF on client<br>
&gt; connection&quot;,,,,,,,,,&quot;slon.node_1_listen&quot;<br>
&gt; 2013-06-13 09:57:38.607 GMT,&quot;postgres&quot;,&quot;db01&quot;,6637,&quot;&lt;ip address printed<br>
&gt; here&gt;:53926&quot;,51b994f9.19ed,1,&quot;idle&quot;,2013-06-13 09:46:33<br>
&gt; GMT,32/0,0,LOG,08006,&quot;could not receive data from client: Connection<br>
&gt; reset by peer&quot;,,,,,,,,,&quot;slon.subscriber_1_provider_1&quot;<br>
&gt; 2013-06-13 09:57:38.607 GMT,&quot;postgres&quot;,&quot;db01&quot;,6637,&quot;&lt;ip address printed<br>
&gt; here&gt;:53926&quot;,51b994f9.19ed,2,&quot;idle&quot;,2013-06-13 09:46:33<br>
&gt; GMT,32/0,0,LOG,08P01,&quot;unexpected EOF on client<br>
&gt; connection&quot;,,,,,,,,,&quot;slon.subscriber_1_provider_1&quot;<br>
&gt; 2013-06-13 09:57:38.608 GMT,&quot;postgres&quot;,&quot;db01&quot;,6635,&quot;&lt;ip address printed<br>
&gt; here&gt;:53925&quot;,51b994f7.19eb,1,&quot;idle&quot;,2013-06-13 09:46:31<br>
&gt; GMT,31/0,0,LOG,08006,&quot;could not receive data from client: Connection<br>
&gt; reset by peer&quot;,,,,,,,,,&quot;slon.node_1_listen&quot;<br>
&gt; 2013-06-13 09:57:38.608 GMT,&quot;postgres&quot;,&quot;db01&quot;,6635,&quot;&lt;ip address printed<br>
&gt; here&gt;:53925&quot;,51b994f7.19eb,2,&quot;idle&quot;,2013-06-13 09:46:31<br>
&gt; GMT,31/0,0,LOG,08P01,&quot;unexpected EOF on client<br>
&gt; connection&quot;,,,,,,,,,&quot;slon.node_1_listen&quot;<br>
&gt;<br>
&gt; The client slon log contains:<br>
&gt; 2013-06-13 09:57:38 GMT FATAL  cleanupThread: &quot;begin;lock table<br>
&gt; &quot;_xx_cluster&quot;.sl_config_lock;select &quot;_xx_cluster&quot;.cleanupEvent(&#39;10<br>
&gt; minutes&#39;::interval);commit;&quot; - server closed the connection unexpectedly<br>
&gt;         This probably means the server terminated abnormally<br>
&gt;         before or while processing the request.<br>
<br>
</div></div>This all can very well be a slightly too eager firewall dropping idle<br>
connections. Have you tried to enable TCP keep alive options that kick<br>
in after something like 30 seconds? If not, enable them on both, the PG<br>
server and the Slony side. That usually prevents those firewall issues.<br>
<br>
<br>
Jan<br>
<div class="im"><br>
<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Sridevi<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Jun 13, 2013 at 12:02 AM, Jan Wieck &lt;<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a><br>
</div><div><div class="h5">&gt; &lt;mailto:<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 06/12/13 10:17, Sridevi R wrote:<br>
&gt;     &gt; Jan,<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks for the reply.<br>
&gt;     &gt;<br>
&gt;     &gt; The only errors in the slon log are failure of cleanupThread.<br>
&gt;     &gt; child process is restarting right after the cleanupThread Failure.<br>
&gt;     &gt; This occurs approximately every 10 minutes since cleanup_interval<br>
&gt;     is set<br>
&gt;     &gt; to 10 minutes.<br>
&gt;     &gt;<br>
&gt;     &gt; Here is a sample from the log again:<br>
&gt;     &gt;<br>
&gt;     &gt; 2013-06-06 14:23:27 GMT FATAL  cleanupThread: &quot;begin;lock table<br>
&gt;     &gt; &quot;_xx_cluster&quot;.sl_config_lock;select &quot;_xx_cluster&quot;.cleanupEvent(&#39;10<br>
&gt;     &gt; minutes&#39;::interval);commit;&quot; - server closed the connection<br>
&gt;     unexpectedly<br>
&gt;     &gt;     This probably means the server terminated abnormally<br>
&gt;     &gt;     before or while processing the request.<br>
&gt;     &gt; 2013-06-06 14:23:27 GMT CONFIG slon: child terminated signal: 9; pid:<br>
&gt;     &gt; 16135, current worker pid: 16135<br>
&gt;     &gt; 2013-06-06 14:23:27 GMT CONFIG slon: restart of worker in 10 seconds<br>
&gt;<br>
&gt;     &quot;server closed the connection unexpectedly&quot; ...<br>
&gt;<br>
&gt;     Is this connection by any chance through some firewall or NAT gateway<br>
&gt;     that will drop idle connections?<br>
&gt;<br>
&gt;     What are the corresponding postmaster server log entries? Since slony<br>
&gt;     reports an unexpected connection drop from the server, the server must<br>
&gt;     have some message in its log too, because the client never sent the &#39;X&#39;<br>
&gt;     libpq protocol message.<br>
&gt;<br>
&gt;<br>
&gt;     Jan<br>
&gt;<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks ,<br>
&gt;     &gt; Sridevi<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; On Wed, Jun 12, 2013 at 7:33 PM, Jan Wieck &lt;<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a><br>
&gt;     &lt;mailto:<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a>&gt;<br>
</div></div><div><div class="h5">&gt;     &gt; &lt;mailto:<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a> &lt;mailto:<a href="mailto:JanWieck@yahoo.com">JanWieck@yahoo.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     On 06/12/13 07:14, Sridevi R wrote:<br>
&gt;     &gt;     &gt; Hello,<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; The slony logs are consistently posting this error:<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; 2013-06-12 10:01:05 GMT FATAL  cleanupThread: &quot;begin;lock table<br>
&gt;     &gt;     &gt; &quot;_xx_cluster&quot;.sl_config_lock;select<br>
&gt;     &quot;_xx_cluster&quot;.cleanupEvent(&#39;10<br>
&gt;     &gt;     &gt; minutes&#39;::interval);commit;&quot; - server closed the connection<br>
&gt;     &gt;     unexpectedly<br>
&gt;     &gt;     &gt; 2013-06-12 10:12:24 GMT FATAL  cleanupThread: &quot;begin;lock table<br>
&gt;     &gt;     &gt; &quot;_xx_cluster&quot;.sl_config_lock;select<br>
&gt;     &quot;_xx_cluster&quot;.cleanupEvent(&#39;10<br>
&gt;     &gt;     &gt; minutes&#39;::interval);commit;&quot; - server closed the connection<br>
&gt;     &gt;     unexpectedly<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; checked and found that sl_confirm table is not cleaned up.<br>
&gt;     cleanup<br>
&gt;     &gt;     event<br>
&gt;     &gt;     &gt; never succeeds.<br>
&gt;     &gt;     &gt; Additionally, the child processes terminates and restarts<br>
&gt;     after each<br>
&gt;     &gt;     &gt; such cleanup failure.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; 2013-06-11 11:20:04 GMT CONFIG slon: child terminated<br>
&gt;     signal: 9; pid:<br>
&gt;     &gt;     &gt; 20172, current worker pid: 20172<br>
&gt;     &gt;     &gt; 2013-06-11 11:20:04 GMT CONFIG slon: restart of worker in 10<br>
&gt;     seconds<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; When cleanup is run manually, on the psql prompt it runs to<br>
&gt;     completion<br>
&gt;     &gt;     &gt; without any issues and cleans up sl_event and sl_confirm tables<br>
&gt;     &gt;     &gt; &quot;begin;lock table &quot;_xx_cluster&quot;.sl_config_lock;select<br>
&gt;     &gt;     &gt; &quot;_xx_cluster&quot;.cleanupEvent(&#39;10 minutes&#39;::interval);commit;&quot;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Soln version: 2.1.2<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Any help/insight would be greatly appreciated.<br>
&gt;     &gt;<br>
&gt;     &gt;     Slon kills its worker(s) with signal 9 (SIGKILL) when it needs to<br>
&gt;     &gt;     restart, like when there are errors in event processing or if it<br>
&gt;     &gt;     receives certain signals. Are there any other errors in the<br>
&gt;     slon log or<br>
&gt;     &gt;     is something on the machine sending signals to slon?<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     Jan<br>
&gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Thanks,<br>
&gt;     &gt;     &gt; Sridevi<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; _______________________________________________<br>
&gt;     &gt;     &gt; Slony1-general mailing list<br>
&gt;     &gt;     &gt; <a href="mailto:Slony1-general@lists.slony.info">Slony1-general@lists.slony.info</a><br>
&gt;     &lt;mailto:<a href="mailto:Slony1-general@lists.slony.info">Slony1-general@lists.slony.info</a>&gt;<br>
</div></div>&gt;     &gt;     &lt;mailto:<a href="mailto:Slony1-general@lists.slony.info">Slony1-general@lists.slony.info</a><br>
<div class=""><div class="h5">&gt;     &lt;mailto:<a href="mailto:Slony1-general@lists.slony.info">Slony1-general@lists.slony.info</a>&gt;&gt;<br>
&gt;     &gt;     &gt; <a href="http://lists.slony.info/mailman/listinfo/slony1-general" target="_blank">http://lists.slony.info/mailman/listinfo/slony1-general</a><br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     --<br>
&gt;     &gt;     Anyone who trades liberty for security deserves neither<br>
&gt;     &gt;     liberty nor security. -- Benjamin Franklin<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;<br>
&gt;     --<br>
&gt;     Anyone who trades liberty for security deserves neither<br>
&gt;     liberty nor security. -- Benjamin Franklin<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Slony1-general mailing list<br>
&gt; <a href="mailto:Slony1-general@lists.slony.info">Slony1-general@lists.slony.info</a><br>
&gt; <a href="http://lists.slony.info/mailman/listinfo/slony1-general" target="_blank">http://lists.slony.info/mailman/listinfo/slony1-general</a><br>
&gt;<br>
<br>
<br>
--<br>
Anyone who trades liberty for security deserves neither<br>
liberty nor security. -- Benjamin Franklin<br>
</div></div></blockquote></div><br></div></div></div></div></div>