electric-sql / electric

Sync little subsets of your Postgres data into local apps and services.
https://electric-sql.com
Apache License 2.0
6.47k stars 156 forks source link

DELETE database_id shall clean up replication slot #1924

Closed balegas closed 1 week ago

balegas commented 2 weeks ago

When we DELETE a database we tear down the processes related with it, but still leave the replication slot. Given this is an action to delete the database, it means the user is no longer interested in shapes sources by it and should delete any associated resources: storage and replication slot.

Leaving replication slots hanging is a problem for users and the WAL file will keep growing unexpectedly. We should also take care of teardown for single-tenant electric #1923.