[Bucardo-general] bucardo internals and updates
sym39
marechal.sylvain2 at gmail.com
Mon Apr 27 15:49:40 UTC 2015
Hello all,
We are using bucardo in multi master mode (all databases are "source"
database) to replicate our technical database. In this configuration,
there are 2 machines: one has the slave role (it does not update the
tables as long as it is the slave) and other is master (it updates the
tables)
For one of the table named events, the master may add or remove or
updates rows. On both the master and the slave, we have built a system
based on the postgres NOTIFY to act accordingly to those modifications
to quickly detect changes without polling the events table.
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 ?
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?
Thanks and regards,
Sylvain
More information about the Bucardo-general
mailing list