[Bucardo-general] feature request

Grant Maxwell grant.maxwell at maxan.com.au
Fri Sep 4 12:15:41 UTC 2009


Hi Everyone

Im finding that I get a LOT of database exceptions of the type:  
concurrency problems.

Sep  4 22:08:45 theconsole Bucardo[21471]: KID Creating savepoint on  
target for exception handler(s)
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Deleting rows from  
public.tblmailaddresslist
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Exception caught for  
t1:public.tblmailaddresslist:: DBD::Pg::db do failed: ERROR:  could  
not serialize access due to concurrent update at /usr/local/share/perl/ 
5.10.0/Bucardo.pm line 4537.
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Rolling back to target  
savepoint, due to database error: ERROR:  could not serialize access  
due to concurrent update
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Trying exception code  
1: mailaddress_in
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Running exception  
custom code 1: mailaddress_in
Sep  4 22:08:45 theconsole Bucardo[21471]: KID ELS DEBUG  
DBIx::Safe=HASH(0x9c046d0)
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Finished custom code 1
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Message from exception  
code 1: problem was concurrency - retrying
Sep  4 22:08:45 theconsole Bucardo[21471]: KID Exception handler  
thinks we can try again

My understanding is that this will happen if, during a transaction  
some other process makes a change to one of the records that are  
affected by the replication.

Assuming this understanding is correct the issue arises a lot because  
there is a large number of records to replicate, and is exacerbated  
because the entire sync fails.
My code (as you can see) sees the error and tells the bucardo to try  
again on the assumption that sometime in the next few seconds the  
record affected will be freed up and the process will complete, but  
this has trouble because there are thousands of records in the sync  
and so chances are another record is being updated.

I think the answer to this is to allow the configuration of the sync  
to specify a max number of records to replicate per transaction.

what do you think ?

regards
Grant



More information about the Bucardo-general mailing list