Error: Replication Slot Concurrency Error
Issue
The connection fails with the following error:
Replication Slot Concurrency Error
Environment
Connector: PostgreSQL
Resolution
To resolve this issue, do the following:
Pause the connection.
i. In Fivetran, go to your PostgreSQL connection page.
ii. In the top right corner, set the ENABLED toggle to OFF.
In PostgreSQL, query
pg_stat_replication
to identify the active sessions using the same replication slot, then identify the Fivetran connections.Terminate conflicting connections using the following command:
SELECT pg_terminate_backend(<pid>);
In Fivetran, resume the connection by setting the ENABLED toggle to ON.
If the issue persists, drop and re-create the replication slot, then initiate a historical sync to reset the connection state.
Cause
This issue occurs when multiple processes try to use the same replication slot simultaneously, which can cause data loss or replication issues. We recommend assigning a unique replication slot to each connection so that we can independently track each connection's position in the Write-Ahead Log (WAL).