[Bucardo-general] Replication failing because of PK violation

Nicolas Garfinkiel nicolas.garfinkiel at gmail.com
Fri Feb 10 18:59:58 UTC 2012


Hey guys,

First of all, thank you so much for Bucardo. It's a great product and
a privilege for it to be open source.

Now, I have this nasty and old PostgreSQL 8.1.23 that I cannot get rid
of, and need badly to replicate. Everything goes smoothly until
erratically my bucardo sync goes numb with the following shwoing in
bucardo.warning.log:

[Thu Feb  9 23:12:31 2012]  KID Warning! Aborting due to exception for
public.mue_destino_mue:? Error was DBD::Pg::db pg_putcopyend failed:
ERROR:  duplicate key violates unique constraint "pk0033"\nCONTEXT:
COPY mue_destino_mue, line 2: "21429574	79	2	2012-02-09
22:40:08.423556-03	3	Sin Posición	f	120	12" at
/usr/lib/perl5/site_perl/5.8.8/Bucardo.pm line 4949.
[Thu Feb  9 23:12:31 2012]  CTL Warning! Kid 8012 seems to have died.
Sync "labdelta"

This is one of other tables that show the same error, and all of them
have one thing in common... Compound primary keys involving a
timestamp column.

I tried to solve the issue by manually executing delete commands over
each of the failing rows in the tables of the target db, and to some
extent it seems to work... That makes me wonder why Bucardo cannot
delete them in the first place.

Actually, this happens only when a certain procedure is triggered that
updates the status of these rows one by one... The procedure sucks,
but I cannot modify it. In fact, I cannot touch anything from the damn
thing!

I did my best to correct this issue, but I both lack the necessary
PERL programming skills and the problem is beyond my understanding of
Bucardo.

Thanks in advance and look forward to hear your thoughts.

Cheers!
Nicolas.


More information about the Bucardo-general mailing list