Dan Falconer lists_slony1-general at avsupport.com
Tue Sep 4 18:53:02 PDT 2007
	I have a Master -> Slave setup for Slony-I replication.  For reasons I've 
been working out on another thread on this list, I have recently been plagued 
with problems from our slave server being constantly behind.  Every week for 
the past month, I've had to rebuild the cluster on monday or tuesday, after 
our main inventory processing is done, to get that slave server back up to 
speed.

	Today, instead of dropping the schema & going through the painful process of 
initializing the cluster, creating the main set (set #1), then subscribing 
the slave, I've decided just to drop the slave node.  After doing this, I was 
surprised to find that Slony didn't automatically truncate all the data in 
sl_log_1 and sl_log_2 (~30.6 million records)... I truncated the tables by 
hand (it only took about 1 second), and then started the slons back up.

	I was then struck by yet another surprise: Slony seems to like keeping all 
it's log data, even when it's the only running node.  I've noticed there have 
been some cleanup processes, but... well, it seems like part of the problem I 
was running into with the slave server being so desperately far behind has 
something to do with an inability to switch log tables:  Take a look at my 
logs (the "NOTICE" lines always seem to be dumped to the console when I 
restart slons, until I open another console)::::

************************* SNIP *************************

pl=# select NOW() AS timestamp, * from _pl_replication.sl_node; SELECT (select 
NOW()) AS time, (select count(*) FROM _pl_replication.sl_log_1) AS 
count_of_slony_log_1, (select count(*) FROM _pl_replication.sl_log_2) AS 
count_of_slony_log_2;
          timestamp           | no_id | no_active |        
no_comment         | no_spool
------------------------------+-------+-----------+---------------------------+----------
 2007-09-04 14:46:56.86454-05 |     2 | t         | Node 2 - 
pl at 192.168.1.201 | f
(1 row)

             time              | count_of_slony_log_1 | count_of_slony_log_2
-------------------------------+----------------------+----------------------
 2007-09-04 14:46:56.865127-05 |                    0 |                25142
(1 row)

pl=# NOTICE:  Slony-I: cleanupEvent(): Single node - deleting events < 73770

pl=# select NOW() AS timestamp, * from _pl_replication.sl_node; SELECT (select 
NOW()) AS time, (select count(*) FROM _pl_replication.sl_log_1) AS 
count_of_slony_log_1, (select count(*) FROM _pl_replication.sl_log_2) AS 
count_of_slony_log_2;
          timestamp          | no_id | no_active |        no_comment         | 
no_spool
-----------------------------+-------+-----------+---------------------------+----------
 2007-09-04 14:52:27.9332-05 |     2 | t         | Node 2 - pl at 192.168.1.201 | 
f
(1 row)

             time              | count_of_slony_log_1 | count_of_slony_log_2
-------------------------------+----------------------+----------------------
 2007-09-04 14:52:27.933927-05 |                    0 |                39972
(1 row)

pl=# NOTICE:  Slony-I: log switch to sl_log_2 complete - truncate sl_log_1

pl=# select NOW() AS timestamp, * from _pl_replication.sl_node; SELECT (select 
NOW()) AS time, (select count(*) FROM _pl_replication.sl_log_1) AS 
count_of_slony_log_1, (select count(*) FROM _pl_replication.sl_log_2) AS 
count_of_slony_log_2;
           timestamp           | no_id | no_active |        
no_comment         | no_spool
-------------------------------+-------+-----------+---------------------------+----------
 2007-09-04 14:52:51.148288-05 |     2 | t         | Node 2 - 
pl at 192.168.1.201 | f
(1 row)

             time              | count_of_slony_log_1 | count_of_slony_log_2
-------------------------------+----------------------+----------------------
 2007-09-04 14:52:51.149097-05 |                    0 |                40182
(1 row)
************************ /SNIP *************************

-- 
Best Regards,


Dan Falconer
"Head Geek", Avsupport, Inc. / Partslogistics.com
http://www.partslogistics.com


More information about the Slony1-general mailing list