[Bucardo-general] Replication problems? data overwritten?

eric machine eric.machine at hotmail.com
Mon Aug 26 15:02:53 UTC 2013


Hi Michelle,

Wow, I liked your proposed replication strategy, that's look good :) Thanks so so much :)

> ALTER SEQUENCE $schema start with 1 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 2 INCREMENT BY 10;
...

By the way, few more questions to clarify further:-

a) 
Because the status is only set after the first successful sync...>> sorry, I am not sure what do you mean by first successful sync? Since autokick is set to yes, shouldn't it be automatically "status = good" when it detects new changes (when insert new record?)?

b)

I'm not running 5 yet - but from my understanding your config would
indicate multimaster between dbbranch1, dbbranch2 and dbbranch3 with the
dbhq being a slave.>> Yes that's correct. But for HQ, I can always create new records but it will never get replicated to the branches. Just I still can't figure out why this will happen?

dbbranch2 -> HQ (correct)
dbbranch1 -> HQ (correct)
dbbranch2 -> dbbranch1 (not supposed to be happen, but it happens, any idea?)

Any help? Thanks.


> Date: Mon, 26 Aug 2013 16:13:57 +0200
> From: michelle at sorbs.net
> Subject: Re: [Bucardo-general] Replication problems? data overwritten?
> To: eric.machine at hotmail.com
> CC: bucardo-general at bucardo.org
> 
> eric machine wrote:
> > Hi Michelle,
> >
> > Thanks for the kind opinion.
> >
> > I tried below here.
> >
> > bucardo install
> > bucardo add database dbbranch1 host=192.168.56.12 dbname=branch1
> > bucardo add database dbbranch2 host=192.168.56.13 dbname=branch2
> > bucardo add database dbbranch3 host=192.168.56.14 dbname=branch3
> > bucardo add database dbhq host=192.168.56.11 dbname=dbhq
> > bucardo add all tables db=dbhq -T nopktable herd=therd
> > bucardo add dbgroup tgroup dbbranch1:source dbbranch2:source
> > dbbranch3:source dbhq:target
> > bucardo add sync foobar herd=therd dbs=tgroup ping=false autokick=0
> > checktime=300
> > bucardo validate foobar
> > bucardo start
> > bucardo kick foobar
> > bucardo status
> > bucardo update sync foobar autokick=1
> > bucardo reload config
> >
> > a) It works. But weird? I insert couple of records after entering the
> > above commands. How come the first 1 - 2 minutes, show records not
> > found. After that, it will show good status. Any idea why?
> 
> Because the status is only set after the first successful sync...
> 
> >
> > b) I have set dbhq as the only target. But how come when I insert data
> > into dbbranch2, the data get replicated into both dbbranch1 and dbhq?
> > Any idea why?
> 
> I'm not running 5 yet - but from my understanding your config would
> indicate multimaster between dbbranch1, dbbranch2 and dbbranch3 with the
> dbhq being a slave.
> >
> > c) to get my data replication working, I manually go to each dbs above
> > and set sequence id as follows.
> >
> > hq:
> > ALTER SEQUENCE $schema start with 1 maxvalue 999999999;
> >
> > dbbranch1:-
> > ALTER SEQUENCE $schema start with 1000000000 maxvalue 1999999999;
> > SELECT setval('$schema'::regclass, (select last_value from $schema) +
> > 1000000000);
> >
> > dbbranch2:-
> > ALTER SEQUENCE $schema start with 2000000000 maxvalue 2999999999;
> > SELECT setval('$schema'::regclass, (select last_value from $schema) +
> > 2000000000);
> >
> > dbbranch3:-
> > ALTER SEQUENCE $schema start with 3000000000 maxvalue 3999999999;
> > SELECT setval('$schema'::regclass, (select last_value from $schema) +
> > 3000000000);
> >
> > Note: my assumption is i doubt each database will ever hit sequence of
> > 1 billion records. Plus the sequence maxvalue is bigint. I assume this
> > works right?
> >
> > Is this the best practice? odd and even only work for 2 databases. Now
> > I have 4 databases.
> 
> You could also do:
> 
> ALTER SEQUENCE $schema start with 1 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 2 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 3 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 4 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 5 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 6 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 7 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 8 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 9 INCREMENT BY 10;
> ALTER SEQUENCE $schema start with 10 INCREMENT BY 10;
> 
> .. if you had 10 DBs and/or wanted to expand to 10 DBs...  Your
> 'increment by' sets the number of possible DBs in your config.
> 
> 
> 
> >
> > d) For autokick, how come I can't set this at the first time?
> >
> > bucardo add sync foobar herd=therd dbs=tgroup ping=false autokick=1
> > checktime=300  // this won't work? if I do "bucardo status all", it
> > will show autokick = no
> >
> Try 'yes' or 'on'... otherwise it's a question for Greg/David to answer
> (I'm not a developer of Bucardo.)
> > but once I do the "bucardo update sync foobar autokick=1", then it
> > will set autokick = 1. That's weird.
> >
> > e) for production use, should i run a .sh script for the above commands?
> 
> If its tested and you're sure it's working... I don't know your setup,
> only this synopsis so can't guarantee it will work or not...
> 
> Regards,
> 
> -- 
> Michelle Sullivan
> http://www.mhix.org/
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20130826/fe6c4ce6/attachment-0001.html>


More information about the Bucardo-general mailing list