Closed alco closed 3 months ago
👋 we've been working the last month on a rebuild of the Electric server over at a temporary repo https://github.com/electric-sql/electric-next/
You can read more about why we made the decision at https://next.electric-sql.com/about
We're really excited about all the new possibilities the new server brings and we hope you'll check it out soon and give us your feedback.
We're now moving the temporary repo back here. As part of that migration we're closing all the old issues and PRs. We really appreciate you taking the time to investigate and report this issue!
@justindotpub has shared their experience of running Electric alongside a Phoenix app on Discord.
One pain point from it that we could improve is to let the Phoenix app drop and recreate the database while Electric keeps running in the background. For that, Electric must close its replication connection to free the database up to being dropped. This can be partially achieved by issuing a
pg_terminate_backend()
command to drop the Postgres' end of Electric's replication connection:However, Electric reconnects before Ecto has time to drop the database.
I'm proposing that we delay Electric's reconnection attempt if it sees that the connection was closed on purpose. Here's what the closure looks like on Electric's side: