[Bucardo-general] patch request

Greg Sabino Mullane greg at endpoint.com
Fri Sep 11 20:49:50 UTC 2009


Hi Grant

Thanks for the code. Unfortunately, it's not quite ready to get added.
The major problems is this:

>  > $err =~ /: "(\d+)\t/;
>  > $pkval = $1;
>  > $self->glog("Exception caught for $sync->{sourcedb}:$S.$T:$pkval: $err");

Here you are assuming that the error message is always going to contain
the primary key in a certain format. This does not cover non-numeric
primary keys, primary keys with multiple columns, and cases in which the
error was caused by some other problem entirely.

That's why we don't return information directly to the customcode about
the row that caused the problem: we have no way of knowing which row
caused the problem. A customcode can certainly parse the error message
itself, as you did above, but all Bucardo knows at that point is that
the DELETE+COPY failed for some reason or another.

We do make some attempts to parse error messages in other places, and
it's possible we could do the same, in addition to looking at the
$dbh->state, and come up with some sort of information to pass to the
customcodes at some point.

For the moment, I would recommend having your customcode itself
determine the errant row - it should have all the database handles and
information necessary to do so.

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 226 bytes
Desc: OpenPGP digital signature
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20090911/77996cc8/attachment.bin 


More information about the Bucardo-general mailing list