How do I scale down volume size in Fly Postgres?

Hi, I want to scale down my volume size in Fly Postgres on my single instance (1 machine) app, I didn’t seem to find anything that works. Here’s what I tried:

I have created a backup for my volume, a .sql file from pg_dump. So I basically just need to create a new volume with smaller GB and then run the psql.

  1. I tried deleting all of my machines and volumes to 0 and then creating it again with smaller volume, but the health check always fails.
  2. I tried creating a new volume with a desired size, scale count to 2, then delete the old primary machine with the bigger volume. And the health check fails because the machine is always a replica, the failover didn’t work.
    Either way, whenever I tried scaling down my machines, it shows error, whether it’s a zombie lock on a zombie role or a no active leader found with on a replica role.

Please help me :slight_smile: :pray:

It’s a little inelegant, but probably it’s easiest to just create a completely new Postgres app (fly pg create).

This older thread might help:

https://community.fly.io/t/urgency-problems-with-postgres-the-database-is-not-responding/19926/2

(You would leave off the --fork-from and --initial-cluster-size in this case, of course.)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.