This walkthrough shows what Hydra ETL does on a real PostgreSQL 16 to protect the source of CDC mirror, in four scenes:
A normal mirror.
The mirror breaks and the WAL piles up: Hydra ETL warns, and a workflow sends an alert.
max_slot_wal_keep_size protects the disk and PostgreSQL invalidates the slot: Hydra ETL stops instead of going on with a gap.
Rebuilding the mirror.
Every screenshot below comes from this exact sequence, run end to end.
0. Prerequisites
Docker
Python 3.10+
The Hydra ETL repository: https://github.com/bejaouibechir/Hydra
Start PostgreSQL with logical replication:
docker run --name hydra-pg-cdc -e POSTGRES_PASSWORD = hydra -p 5433:5432 -d postgres:16 -c wal_level = logical
Enter fullscreen mode
Exit fullscreen mode
Go to the example, create its .env , and create the two databases: shop (the application) and analytics (the mirror):
git clone https://github.com/bejaouibechir/hydra-tuto-cdc-slot-protection.git cd examples/postgres-cdc-mirror printf…