<div dir="ltr">this is what i found on slony log : <div><div><br></div><div>postgres@myserver:~$ tail -f /var/log/slony1/slon-myserver.log | grep -i -e lock -e &quot;log switch&quot;</div></div><div><div>NOTICE:  Slony-I: log switch to sl_log_2 complete - truncate sl_log_1</div>
<div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: log switch to sl_log_1 still in progress - sl_log_2 not truncated</div>
<div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div>
<div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: log switch to sl_log_1 still in progress - sl_log_2 not truncated</div><div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div>
<div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated<br></div><div>NOTICE:  Slony-I: could not lock sl_log_2 - sl_log_2 not truncated</div></div><div><br></div><div>Truncating sl_log_2 always failed. and yes the slave is falling behind the master. usually the slave will catch up again later after the busy hours. Maybe this is due to high transactional load. But is there a way we can keep slave to catch up the master?</div>
<div><br></div><div>Thanks....</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 25, 2014 at 10:04 PM, Steve Singer <span dir="ltr">&lt;<a href="mailto:ssinger@ca.afilias.info" target="_blank">ssinger@ca.afilias.info</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/25/2014 11:00 AM, Soni M wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everyone,<br>
<br>
Is it OK to delete event log that has been replicated in sl_log_x.<br>
<br>
</blockquote>
<br>
<br></div>
No you shouldn&#39;t do that.<br>
<br>
You should instead figure out why the slony cleanup event isn&#39;t performing a log switch.  Perhaps because you have a node behind or because confirmations are not making it back to the origin?<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Here&#39;s the function I created :<br>
<br>
CREATE OR REPLACE FUNCTION _slony_example.delete_sl_log()<br>
  RETURNS void<br>
  LANGUAGE plpgsql<br>
AS $function$<br>
DECLARE<br>
         v_origin        int8;<br>
         v_seqno         int8;<br>
         v_xmin          bigint;<br>
BEGIN<br>
<br>
<br>
                 for v_origin, v_seqno, v_xmin in<br>
                   select ev_origin, ev_seqno,<br>
&quot;pg_catalog&quot;.txid_snapshot_<u></u>xmin(ev_snapshot) from &quot;_slony_example&quot;.sl_event<br>
                   where (ev_origin, ev_seqno) in (select ev_origin,<br>
min(ev_seqno) from &quot;_slony_example&quot;.sl_event where ev_type = &#39;SYNC&#39;<br>
group by ev_origin)<br>
                 loop<br>
<br>
delete from _slony_example.sl_log_1 where log_origin = v_origin and<br>
log_txid &lt; v_xmin;<br>
delete from _slony_example.sl_log_2 where log_origin = v_origin and<br>
log_txid &lt; v_xmin;<br>
                 end loop;<br>
<br>
END;<br>
$function$;<br>
<br>
The Slony failed to switch sl_log for several hours, and event log keep<br>
accumulated in a table.<br>
<br>
Will this action help to reduce slony lag that falls far behind ?<br>
<br>
Thanks all.<br>
<br>
--<br>
Regards,<br>
<br>
Soni Maula Harriz<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
Slony1-general mailing list<br>
<a href="mailto:Slony1-general@lists.slony.info" target="_blank">Slony1-general@lists.slony.<u></u>info</a><br>
<a href="http://lists.slony.info/mailman/listinfo/slony1-general" target="_blank">http://lists.slony.info/<u></u>mailman/listinfo/slony1-<u></u>general</a><br>
<br>
</blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Regards,</div><div><br></div>Soni Maula Harriz</div>
</div>