[Bucardo-general] Migrate Data Between RDS Postgres Clusters using Bucardo

Ben Chobot bench at silentmedia.com
Thu Jan 20 23:26:52 UTC 2022


I can't authoritatively speak to most of your questions, but...

Su Yu wrote on 1/20/22 3:02 PM:
> *Question 2: Table has "auto increment" primary key.*
> We have some use cases using sequence nextval to generate incremental 
> numbers as the primary keys for the table. And I have a concern about 
> key collisions during migration. Because when we switch the 
> application endpoint, we will have moments that application pods point 
> to both old and new clusters. That might have a chance to create 
> primary key collisions. Is this concern valid?
Yes, this is absolutely a concern. We have the same problem independent 
of RDS. Before you enter the transient switchover period when you are 
rolling with a real multi-master database, you'll want to tweak your 
sequences so that one db will only make even values and the other only 
odd values. (Or use different math if you have more than one potential 
source of ids, but the key is that you're going to need to make sure 
your sequences are set up to not make id conflicts.)

After your migration, you can tweak your sequences to autoincrement by 1 
again (or whatever is appropriate for you).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://bucardo.org/pipermail/bucardo-general/attachments/20220120/d5861b79/attachment.htm>


More information about the Bucardo-general mailing list