IT lexicon › Database › Replication slot

Replication slot

Database På svenska → Updated: 2026-05-27

PostgreSQL mechanism: server reserves WAL segments until a specific consumer (replica or logical decoding client) has confirmed receipt. Guarantees consumer never misses data, but risk: disk-space bloat if consumer dies.

Created: SELECT pg_create_physical_replication_slot('replica1') (for replicas) or logical_slot (for Debezium etc). When a replica lags WAL must be retained — pg_wal directory grows. Classic outage: replica down over the weekend → 200 GB WAL bloat → master gets disk full. Monitoring mandatory: pg_replication_slots.confirmed_flush_lsn. max_slot_wal_keep_size (PG 13+) caps bloat — slot is dropped if the limit is hit, replica must be re-synced.

← Back to the lexicon