electric icon indicating copy to clipboard operation
electric copied to clipboard

Electric fails to detect when its persistent storage goes away and prevents Postgres from cleaning up WAL files

Open alco opened this issue 5 months ago • 4 comments

Imagine a simple scenario where Electric is running inside a Kubernetes pod with no persistent storage. Some shapes get created, so Electric creates a publication in Postgres and starts processing transactions.

When the pod is restarted, a new file system is created for it with no traces of the previous shape storage. Electric will no longer be able to process incoming transactions from Postgres, causing the latter to build up its WAL backlog indefinitely.

Electric should be able to detect this failure mode and drop transactions when there is no active shape collector process instead of keeping those transactions around by refusing to advance the replication slot.

alco avatar Sep 17 '24 07:09 alco