Nickolay info at zhukcity.ru
Sun Dec 14 22:39:03 PST 2008
Hi everybody,

I've been playing around with PostgreSQL 8.3 and Slony 2.0 for a week and
ran into the problem with slony logs are not being truncated like this:

CONTEXT:  PL/pgSQL function "cleanupevent" line 99 at assignment
NOTICE:  Slony-I: log switch to sl_log_2 still in progress - sl_log_1 not
truncated

And this was a permanent condition, i.e. one of the logs has been growing
up to millions of rows and never cleared up.
After some tests and playing around with settings, i have set
cleanup_deletelogs flag to true (1), and this fixes the problem with logs
not being truncated, BUT also this leads to data loss when slave server is
down for a period of time. So this is definately not the kind of solution
I was seeking for :-).

After looking into logswitch_finish() function I've found something strange:

...
if exists (select 1 from "_CKS_Cluster".sl_log_2 where log_origin =
v_origin and log_txid < v_xmin limit 1) then
...

Isn't it supposed to be:

...
if exists (select 1 from "_CKS_Cluster".sl_log_2 where log_origin =
v_origin and log_txid >= v_xmin limit 1) then
...

? If I understand it the right way, this is the condition to determine if
there is any transaction in the log which is not yet passed to slaves
(confirmed). So why "<"?
After I changed both such strings (for sl_log_1 and sl_log_2) to log_txid
>= v_xmin, everything seems to work fine.
But I would like to hear if this is a correct solution.

Many thanks!

-- 
Best regards, Nick Karih.



More information about the Slony1-general mailing list