fly_postgres_elixir icon indicating copy to clipboard operation
fly_postgres_elixir copied to clipboard

Writes fail (RPC timeouts) whenever the DB is not available in the current region

Open Qqwy opened this issue 1 year ago • 1 comments

Attempting to use the Fly repo from any region in which a replica is not yet running, seems to work perfectly fine...

... that is, until any mutating calls (insert, update etc), or calls like Fly.Postgres.rpc_and_wait are made. Instead of transparently falling back to directly using the sole available DB connection (and maybe logging a warning?), these RPC calls will always time out.


At first I thought this was just a 'principle of least surprise' kind of issue that users which follow the guide to the letter would not stumble across. But actually the problematic situation can also arise during normal operation: When the read replica in the local region fails, DB traffic from that region is again transparently rerouted to the primary DB and the same situation occurs!

Qqwy avatar Mar 21 '23 16:03 Qqwy