<@U04S8PLJWMT> How to fix this error: `Failure in ...
# ask-ai
j
@kapa.ai How to fix this error:
Failure in source: Saved offset is before replication slot's confirmed lsn. Please reset the connection, and then increase WAL retention and/or increase sync frequency to prevent this from happening in the future. See https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs for more details.
In postgres to redshift replications?
k
The error message:
Copy code
Failure in source: Saved offset is before replication slot's confirmed lsn. Please reset the connection, and then increase WAL retention and/or increase sync frequency to prevent this from happening in the future. See https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs for more details.
indicates that Airbyte's saved offset (the last processed position in the WAL) is older than what PostgreSQL still retains in the replication slot. This usually happens when WAL files needed for incremental syncs are purged before Airbyte can read them. Here’s how to address this issue: ### 1. Reset the Connection - Resetting the connection will clear the saved state and allow Airbyte to perform a new initial sync. This is required to recover from this error state. ### 2. Increase WAL Retention - Increase the WAL retention settings in PostgreSQL to ensure WAL files are kept long enough for Airbyte to process them. Adjust the following parameters: -
wal_keep_size
(in MB, default is 0): Increase this to retain more WAL files. - `max_slot_wal_keep_size`: Set this higher to prevent WAL files needed by replication slots from being purged. - Example:
Copy code
sql   ALTER SYSTEM SET wal_keep_size = '10GB';   ALTER SYSTEM SET max_slot_wal_keep_size = '10GB';   SELECT pg_reload_conf();
This ensures that WAL files are retained for a longer period, reducing the risk of this error if syncs are infrequent or the database is busy. ### 3. Increase Sync Frequency - Run Airbyte syncs more frequently so that WAL files are processed before they are purged by PostgreSQL. If you sync rarely and your database is busy, WAL files may be removed before Airbyte can read them. ### 4. Additional Notes - This issue can also occur if there is a misconfiguration or a bug in the connector version. If you are using an older version of the Postgres source connector, consider upgrading to the latest stable version, as some older versions had known issues with CDC state management. In some cases, downgrading to a specific version (e.g., 3.6.18) has been reported as a workaround for certain CDC issues, but this should be a last resort if upgrading does not help and is only relevant for specific connector versions [[source](https://github.com/airbytehq/airbyte/issues/49802)]. - If you are using a low-traffic database, consider adding a high-transaction table to the publication or using a heartbeat table to ensure the WAL advances as expected [[source](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query)]. ### References - For more details and troubleshooting steps, see the official Airbyte documentation: [Under CDC incremental mode, there are still full refresh syncs](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs). --- Summary: Reset the connection, increase WAL retention settings, and/or increase sync frequency to prevent this error from recurring. If the problem persists, review your connector versions and consider using a heartbeat table if your database has low transaction volume [[source](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs)].