[Bucardo-general] seems I found a bug...

Michelle Sullivan michelle at sorbs.net
Wed Sep 1 09:21:34 UTC 2010


A swap sync with 2 databases in differing timezones fails when a pk
contains a timestamptz.  I thought that using a 'SET TIME ZONE' patch to
make the timezones all the same would work well - except when it comes
to reading the bucardo_delta table..  The pk is stored as text in one or
more rows and therefore is stored as the local timezone to that database
(by the trigger).

A seemingly simple solution would be to cast any row that has a
timestamp(tz) to it's type when querying bucardo_delta and setting a
common timezone on all the DBs (the local time zone for the bucardo
process would be my first thought, but perhaps the "masterDB" should be
used).  Currently with this bug I'm seeing this:

[Wed Sep  1 03:44:54 2010] KID Total delta count: 3
[Wed Sep  1 03:44:54 2010] KID No conflict, source only for
public.authorisation.sid|rolesid|assigned: 100|2|2010-08-05
19:43:39.950517+10
[Wed Sep  1 03:44:54 2010] KID Action summary: 1:1
[Wed Sep  1 03:44:54 2010] KID [1/1] public.authorisation INSERT source
to target pk 100|2|2010-08-05 19:43:39.950517+10
[Wed Sep  1 03:44:54 2010] KID Warning! Aborting due to exception for
public.authorisation.sid|rolesid|assigned: 100|2|2010-08-05
19:43:39.950517+10 Error was DBD::Pg::st execute failed: ERROR: 
duplicate key value violates unique constraint "Authorisation_pkey" at
/usr/local/lib/perl5/site_perl/5.10.1/Bucardo.pm.

...and this appears to have been what caused my de-sync in the first
place... :-(


Regards,

Shells



More information about the Bucardo-general mailing list