TLDR: We’re going to start migrating machines with volumes soon. If your application records 6PN addresses and assumes they won’t change forever, you need to update your application to prepare for machine migration.
Since the launch of Apps V2 platform, machines have been strongly tied to their underlying hosts. It is simpler and more predictable than our previous orchestrator. Once your machine is started, it is kept on the host until the machine is explicitly destroyed.
However, this strong coupling between machines and our physical hosts makes it challenging to scale our large fleet of servers without disrupting your workloads. As we scale our fleet, we have new hosts with more redundancy and better performance than older servers that have been running for years. Moving machines off older servers also makes it possible to us upgrade our overall platform and deploy new software fixes and features more quickly.
So, we are building a new capability into our platform - migrating machines from one host to another. This is not “live” migration. We explicitly stop your machine first and create another one on a different host.
A new machine has the same machine ID. Any attached volumes have the same content as the original, although the volume ID will change. The 6PN address will be different from the original machine.
We’ve already started migrating machines without volumes and will migrate machines with volumes soon. Because of the previous Fly Postgres breakage, we are holding off migrating HA Postgres applications, but we are going to support the case in the coming weeks.
What do you need to do?
Please make sure that your application is not directly depending on 6PN addresses’ stability.
- Most web applications don’t need to know 6PN addresses at all. They should be fine.
- If your application uses our internal DNS to have 6PN addresses on the fly, it should be fine.
- If your application records 6PN addresses and assumes they won’t change forever, you need to update your application to prepare for machine migration.
FAQ
How does Fly Postgres handle machine migration?
We are going to issue a few repmgr commands during migration to let the primary know the standby machines’ addresses are changed. While Fly Postgres is not “managed” Postgres (Supabase is!), we will do our best to keep your Postgres running without issues.
How do I know if my machine have been migrated?
We are going to expose machine events from flyctl and/or fly.io/dashboard
.
Would machine migration corrupt volumes?
No. Machine migration will stop your machine first to make sure there are no in-flight writes. Please make sure your application handles Unix signals accordingly.
Would machine migration potentially kill in-flight requests?
Like above, machine migration will stop your machine first by sending signals. Please make sure your application handles Unix signals accordingly.