[Bucardo-general] Burcardo.pm 4.4.8 crashed on small systems - patch attached

Armin Resch armin at reschab.net
Fri Dec 14 20:41:58 UTC 2012


we had a situation in which our memory-constrained device would pick
bucardo_ctl or a postgres backend as a candidate to be killed when more
than 3,000 deltas would have to be copied to a slave in one transaction. I
attached a patch to correct the situation and was wondering whether it can
be considered to be applied upstream - at least for B4; it applies to the
PUSHDELTA section. In addition to the smaller chunk size (which admittedly
might not be ideal for larger systems), it contains the following changes:

1 - Allow tables to be replicated which contain unique keys where one or
more columns are NULL
2 - performance improvement by refactoring processing of the delta record

With regard to (1), we found out that Bucardo would not replicate unique
keys containing NULLs because the Postgres syntax does not produce output
for the following WHERE clause:

WHERE (col1,col2,col3,col4) IN (('A','B',NULL,'D'),('A',NULL,'C',NULL))

The algorithm would split those COPY operations into two separate queries
as such:

A) <blah> WHERE (col1,col2,col4) IN (('A','B','D')) AND col3 IS NULL
B) <blah> WHERE (col1,col3) IN (('A','C') AND col2 IS NULL AND col4 IS NULL

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20121214/0929b7b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bucardo-4.4.8.pm.diff
Type: application/octet-stream
Size: 14832 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20121214/0929b7b9/attachment.obj>

More information about the Bucardo-general mailing list