electric icon indicating copy to clipboard operation
electric copied to clipboard

Terminate electric admin endpoint

Open balegas opened this issue 1 year ago • 2 comments

We need a termination endpoint for Electric to cleanup storage and remove any existing replication slot.

Right now if someone wants to stop using Electric, they need to manually remove the replication slot from Postgres, otherwise WAL will keep growing.

balegas avatar Nov 05 '24 09:11 balegas

Doesn't have to be an endpoint, can just be the terminate action

balegas avatar Nov 05 '24 10:11 balegas

@robacourt did we end up introducing any endpoint for a controlled shutdown of a single Electric that cleans up the replication slot? If not (cause I don't see one), should we add one?

We already have an environment variable called CLEANUP_REPLICATION_SLOTS_ON_SHUTDOWN which defaults to false, that would create a temporary replication slot such that it is automatically cleaned up when electric shuts down. Perhaps this is enough for use cases where an Electric is transient, and for cases where someone wants a persistent slot between restarts we should advise they manually clean the slot?

msfstef avatar Nov 27 '24 10:11 msfstef