CVS User Account cvsuser
Wed Sep 29 00:30:15 PDT 2004
Log Message:
-----------
Added code to the cleanup SP to remove confirm entries for 
non-existing nodes. There is a possible overlap when dropping
a node and slon inserting confirm records. If this happened,
log never got removed any more.

Also ignore confirms that are younger than 10 minutes. We had 
a case that is not entirely clear yet, but it looks as due to
some server crash replication needed to be redone, but the 
provider had already deleted the event and log rows.

Jan

Modified Files:
--------------
    slony1-engine/src/backend:
        slony1_funcs.sql (r1.28 -> r1.29)

-------------- next part --------------
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.28
retrieving revision 1.29
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.28 -r1.29
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -3456,8 +3456,20 @@
 	-- ----
 	-- First remove all but the oldest confirm row per origin,receiver pair
 	-- ----
+	delete from @NAMESPACE at .sl_confirm
+				where con_origin not in (select no_id from @NAMESPACE at .sl_node);
+	delete from @NAMESPACE at .sl_confirm
+				where con_received not in (select no_id from @NAMESPACE at .sl_node);
+	-- ----
+	-- Next remove all but the oldest confirm row per origin,receiver pair.
+	-- Ignore confirmations that are younger than 10 minutes. We currently
+	-- have an not confirmed suspicion that a possibly lost transaction due
+	-- to a server crash might have been visible to another session, and
+	-- that this led to log data that is needed again got removed.
+	-- ----
 	for v_max_row in select con_origin, con_received, max(con_seqno) as con_seqno
 				from @NAMESPACE at .sl_confirm
+				where con_timestamp < (CURRENT_TIMESTAMP - ''10 min''::interval)
 				group by con_origin, con_received
 	loop
 		delete from @NAMESPACE at .sl_confirm


More information about the Slony1-commit mailing list