[Bucardo-general] bucardo internals and updates

Greg Sabino Mullane greg at endpoint.com
Mon May 11 18:23:13 UTC 2015

On Mon, Apr 27, 2015 at 05:49:40PM +0200, sym39 wrote:
> 1) About rows updates:
> I understand that lines updates are replicated on the slave by first
> removing all impacted lines then by adding the updated (master)
> lines. I guess this is done inside a transaction, so I guess it is
> never possible to have one race condition that would show the
> temporary deleted lines as deleted lines while getting the content
> of the events table "at the same time" it is updated by bucardo ? In
> other words, after an update on the master, a single "select * from
> events" on the slave will never display less lines than there are on
> the master even if the select is done "in the middle of" the bucardo
> replication job.
>  Am I right ?

Correct. All of the replication happens inside of a transaction, so 
other connections will only see the final state after all the changes 
have been applied.

> 2) About notifications, add/remove and always trigger:
> Each time a modification (add/remove/update) is done on a row, a
> trigger is called and notifies about the change. To make sure that
> notifications are sent on the slave, we have updated the triggers as
> always trigger.
> This works for add and remove, but as an update is done with delete
> followed by copy, we have some difficulties to make the distinction
> between a "real" add, a "real" remove and an update that leads to
> remove/add events.
> Any ideas about that?

Do not set the triggers as 'always' - as you found out, that can lead 
to confusion. Why does the default trigger behavior (e.g. 'origin', 
not 'always'), work for you? There are some other workarounds that 
should be tried before resorting to setting triggers as 'always'.

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: 163 bytes
Desc: Digital signature
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20150511/a4d75f4a/attachment.sig>

More information about the Bucardo-general mailing list