[Bucardo-general] duplicate key value violates unique constraint "bucardo_sequences_tablename"

Jonathan Brinkman jb at blackskytech.com
Sat Aug 10 12:50:05 UTC 2013


Thanks so much. I'll try your SQL now.

Goodness I did paste the wrong syncs there.
These are the correct Master-to-2-slaves syncs that I will need to modify to
use the DBGroup as targetdb:
bucardo_ctl add sync cmsfgcc_pushdelta_main_to_gate1
source=cmsfgcc_main_to_gate targetdb=cmsfgcc_gate1 type=pushdelta 
bucardo_ctl add sync cmsfgcc_pushdelta_main_to_gate2
source=cmsfgcc_main_to_gate targetdb=cmsfgcc_gate2 type=pushdelta 

Thanks again

-----Original Message-----
From: Michelle Sullivan [mailto:michelle at sorbs.net] 
Sent: Saturday, August 10, 2013 8:24 AM
To: Jonathan Brinkman
Cc: bucardo-general at bucardo.org
Subject: Re: [Bucardo-general] duplicate key value violates unique
constraint "bucardo_sequences_tablename"

Jonathan Brinkman wrote:
> That's clever, thank you.
> I am using 4.5.0
> How did you create the DBGroup with bucardo_ctl?
> There are 4 syncs total, 2 are push from Master to the slaves as 
> discussed, and 1 push-delta sync comes from each slave to Master. 
> Those other 2 (from slave to master) work fine.
>   

I didn't use bucardo_ctl (as I said) I did it in the DB...

psql -U bucardo bucardo will get you in there...

Then something like this shoudl work:

BEGIN;
INSERT INTO dbgroup (name, cdate) VALUES ('mydbseqsyncgrp', NOW()); INSERT
INTO dbmap (db, dbgroup, priority, cdate) VALUES ('cmsfgcc_gate1',
'mydbseqsyncgrp', 1, NOW()),('cmsfgcc_gate2', 'mydbseqsyncgrp', 1, NOW());
COMMIT;

Then add your sync with:

bucardo_ctl add sync cmsfgcc_pushdelta_gates_to_main source=cmsfgcc_main
targetdb=mydbseqsyncgrp type=pushdelta



... However, just re-reading your setup (I only quickly skimmed it at
first)... have you checked it's right...?

bucardo_ctl add sync cmsfgcc_pushdelta_gate2_to_main
source=cmsfgcc_gate2_to_main targetdb=cmsfgcc_main type=pushdelta
bucardo_ctl add sync cmsfgcc_pushdelta_gate1_to_main
source=cmsfgcc_gate1_to_main targetdb=cmsfgcc_main type=pushdelta


Both your targetdbs are the same... that doesn't look right ... perhaps you
meant to add them the other way around where the source is cmsfgcc_main and
the targets are to be gate1 and gate2...?

Regards,

Michelle

> -----Original Message-----
> From: Michelle Sullivan [mailto:michelle at sorbs.net]
> Sent: Saturday, August 10, 2013 7:48 AM
> To: Jonathan Brinkman
> Cc: bucardo-general at bucardo.org
> Subject: Re: [Bucardo-general] duplicate key value violates unique 
> constraint "bucardo_sequences_tablename"
>
> I ran into this very problem a couple of days ago.
>
> The work around I found is to delete the syncs, then create a DBGroup 
> with the 2 slaves in it, and add a single sync with the DB group as the
target.
>
> If you have other seperate syncs to the 2 slaves it's a good idea to 
> do the same with them, but if you can't you can create this setup 
> manually by manipulating the bucardo config tables (I don't know if 
> you can do it with Bucardo_ctl as I didn't try.)
>
> NB: I'm working with 4.5.0, I have no idea whether this will work with
> 4.99.7 (but it *should*)
>
>   


--
Michelle Sullivan
http://www.mhix.org/




More information about the Bucardo-general mailing list