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

Juned Khan jkhan6722 at gmail.com
Wed May 14 06:48:15 UTC 2014


I think this problem is because i am not replicating sequences so sequences
are not updating and as result when i am trying to add rows from another
master its trying to start from first. in that case its giving duplicate
error.

So i think i should check with adding sequence too. it doesn't work and i
can go with odd even sequence solution.


On Wed, May 14, 2014 at 12:11 PM, Rosser Schwarz
<rosser.schwarz at gmail.com>wrote:

> 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
>



-- 
Thanks,
Juned Khan
iNextrix Technologies Pvt Ltd.
www.inextrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20140514/4259c751/attachment.html>


More information about the Bucardo-general mailing list