[Bucardo-general] validate_sync help
rosser.schwarz at gmail.com
Sat Mar 19 22:18:39 UTC 2011
On Sat, Mar 19, 2011 at 2:03 PM, Banny Chu <bannychu at gmail.com> wrote:
> ... Table "public.definitions" must specify a way to handle conflicts ...
> Please help me, Thx so much !
In a swap sync, Bucardo needs to know how to handle conflicts between
rows, where the same row is updated on both masters in a small enough
window that it would otherwise need to replicate the changed rows in
both directions. Rather than guess, it wants you to specify which row
should "win". This is done using the "standard_conflict" column on
the "bucardo.goat" table in the "bucardo" database.
For tables, the valid values are "source", "target", "skip", "random",
"latest", and "abort". "latest" is usually what you want, though not
always. To specify which conflict resolution strategy Bucardo should
use, you'll need to connect to your "bucardo" database and UPDATE the
row for "definitions" in the "bucardo.goat" table.
Note that, if you're going to have clients writing to both databases,
and adding rows to your "definitions" table, you'll also need to take
some special care with the sequence that populates your "id" column.
The usual approach is to set the sequences to alternate, so that rows
in the "test1" database get odd values, and rows in the "test2" db get
even ones. Look at the START and INCREMENT clauses for CREATE/ALTER
SEQUENCE in the PostgreSQL docs for more information. There's also an
article about using sequences with Bucardo on the wiki at bucardo.org.
More information about the Bucardo-general