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

Su Yu su.yu.tech at outlook.com
Fri Jan 21 19:28:11 UTC 2022


Hi Ben,

Thank you so much for your quick response.

Yeah, that is a work around to avoid the auto incremental number collision.

Also, based on your experience, do you have any thoughts on my other questions? Don't have to be exact answer, just want to learn from your experience, since we are very new to this tool.

Thank you so much.

Take care,

Su.


________________________________
From: Ben Chobot <bench at silentmedia.com>
Sent: Thursday, January 20, 2022 3:26 PM
To: Su Yu <su.yu.tech at outlook.com>
Cc: bucardo-general at bucardo.org <bucardo-general at bucardo.org>
Subject: Re: [Bucardo-general] Migrate Data Between RDS Postgres Clusters using Bucardo

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/20220121/112ca7ed/attachment.htm>


More information about the Bucardo-general mailing list