[Bucardo-general] ERROR: duplicate key value violates with master master replication

Rosser Schwarz rosser.schwarz at gmail.com
Wed May 14 06:41:07 UTC 2014


On Tue, May 13, 2014 at 11:13 PM, Juned Khan <jkhan6722 at gmail.com> wrote:

> Thanks for the answer, if i use this command to add all tables then
> sequence will be added automatically for replication ?
>
>> bucardo add all tables db=master1 herd=mherd
>
>
That command will only add *tables* to the things Bucardo knows to
replicate. The bucardo command also has an "add all sequences" operation,
which you should not perform for your scenario.

with live database whenever first master will go down then second master db
> will be used for write process, how do i manage that with sequence ?
>

Both databases should have all of your tables and sequences, but Bucardo
should be configured to replicate only the tables.

On db1, you then set the sequences to issue only *odd* numbers. ("ALTER
SEQUENCE foo START 1 INCREMENT 2;" — produces 1, 3, 5...)

On db2, you set them to issue only *even* numbers. ("ALTER SEQUENCE foo
START 2 INCREMENT 2;" — produces 2, 4, 6...)



-- 
:wq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20140513/1c5ecb91/attachment-0001.html>


More information about the Bucardo-general mailing list