Error: Replication Slot Invalidated by Idle Timeout
Issue
The following error appears:
We could not sync your data because the replication slot has become invalid. This slot was invalidated because it was idle for too long (`idle_replication_slot_timeout` on your PostgreSQL server).
Environment
- Connector: PostgreSQL
- Incremental Update Method: Logical replication
- PostgreSQL version: 18+
Resolution
Step 1: Prevent invalidation
Configure the idle_replication_slot_timeout parameter to either disable or set it to at least 24 hours, then reload the configuration:
-- Option A: Disable (recommended)
ALTER SYSTEM SET idle_replication_slot_timeout = 0;
-- Option B: Set to 24 hours minimum
ALTER SYSTEM SET idle_replication_slot_timeout = '24h';
SELECT pg_reload_conf();
Step 2: Recreate the replication slot
Once a replication slot is invalidated, you must drop the slot and recreate it. Connect to the correct database (the one configured in your Fivetran connection) and run:
-- Drop the invalidated slot
SELECT pg_drop_replication_slot('fivetran_pgoutput_slot');
-- Recreate the slot
SELECT pg_create_logical_replication_slot('fivetran_pgoutput_slot', 'pgoutput');
Replace fivetran_pgoutput_slot with your actual slot name.
Step 3: Perform a full historical re-sync
You must trigger a full re-sync of your connection, because the new slot does not have access to WAL history generated before it was created. To learn how, see How to Trigger Historical Re-Syncs for Fivetran Connections.
Cause
PostgreSQL 18 introduced the idle_replication_slot_timeout parameter.
When the parameter is set to a non-zero value, PostgreSQL automatically invalidates logical replication slots that have not been consumed for longer than the configured duration. Unlike other slot invalidation causes, an idle timeout does not set conflicting = true on the slot — instead, invalidation_reason is set to idle_timeout in pg_replication_slots.
If your sync interval is longer than the configured timeout, the replication slot may be invalidated while Fivetran is not actively syncing.