Two tables in SLONY - sl_log_1 and sl_log_2 stores the changes which need to be propagated to the subscriber nodes. Slony will try to log switch between both of these tables and truncate each of them once all the changes are propagated to the subscriber node. Sometimes there is a chance that these tables grow very huge because of a big table or large data set sync. You could also notice in the logs that SYNC events are taking long time.
Also you may get this error in slony log in master
NOTICE: Slony-I: could not lock sl_log_1 - sl_log_1 not truncated
Finding number of records yet to be processed by slony is important.
Query to find number of records in sl_log_1 yet to be processed by slony
select count(*) from sl_log_1 where log_txid>(select split_part(cast(ev_snapshot as text),':',1)::bigint from sl_event where ev_seqno=(select st_last_event from sl_status));
similarly you can find number of records yet to be processed in sl_log_2 using
select count(*) from sl_log_2 where log_txid>(select split_part(cast(ev_snapshot as text),':',1)::bigint from sl_event where ev_seqno=(select st_last_event from sl_status));
similarly you can find number of records yet to be processed in sl_log_2 using
select count(*) from sl_log_2 where log_txid>(select split_part(cast(ev_snapshot as text),':',1)::bigint from sl_event where ev_seqno=(select st_last_event from sl_status));
No comments:
Post a Comment