PostgreSQL Logical Replication Slot WAL Lag & Disk-Full Circuit Guard
Monitors CDC logical replication slot retained WAL bytes against volume free space and max_slot_wal_keep_size locally, preventing stalled downstream consumers from crashing primary storage.
Governed Workflow Steps (3)
- 1. Read pg_replication_slots Retained
Read pg_replication_slots Retained WAL Bytes & WAL Generation MB/s: consume [slotSnapshot] via ingest.local_replication_slot_reader to emit [walState]. Verify invariant: walState.walRateMbSec > 0.
- 2. Compute Hours-to-Disk-Exhaustion &
Compute Hours-to-Disk-Exhaustion & Safe max_slot_wal_keep_size Cap: consume [walState] via vault.vault-postgres-logical-replication-wal-lag-slot to emit [hoursUntilDiskFull, safeSlotCapGb, spillRiskLevel]. Verify invariant: safeSlotCapGb > 0 && hoursUntilDiskFull > 0.
- 3. Emit DBA Slot Cap Guardrail &
Emit DBA Slot Cap Guardrail & Consumer Catch-Up Playbook: consume [hoursUntilDiskFull, safeSlotCapGb] via artifact.local_wal_guard_emitter to emit [dbaRunbookMd]. Verify invariant: dbaRunbookMd.length > 80.