<#C01AHCD885S> Postgres syncing error: Saved offse...
# replication-ask-ai
j
#C01AHCD885S Postgres syncing error: 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. It does not look to me like the current lag value is above the wal_keep_size value set
k
This error ("Saved offset is before replication slot's confirmed lsn") can occur even when WAL retention settings appear sufficient. There are a few known causes and workarounds: Known Root Causes 1. PgJDBC Regression (Connector versions â‰Ĩ 3.6.19) A regression in PgJDBC 42.7.0+ causes
confirmed_flush_lsn
to automatically advance even when there are no new events for the publication tables — meaning the replication slot's LSN moves ahead of Airbyte's saved state, triggering this error. This is a known bug affecting connector versions 3.6.19 through at least 3.7.0. [CDC LSN issue] 2. Low Transaction Volume / WAL Disk Consumption On databases with low write activity, the WAL log sequence number may not advance naturally, causing similar LSN mismatches. [WAL disk consumption] ------------------------- Recommended Fixes Option A: Upgrade to connector version 3.7.2+ A fix was released in version
3.7.2
. Users have confirmed this resolves the issue. [CDC LSN issue] Option B: Downgrade to connector version 3.6.18 or 3.6.15 (temporary workaround) If upgrading isn't immediately possible, reverting to
3.6.18
or
3.6.15
has been confirmed to avoid the bug. [CDC LSN issue] Option C: Set up a heartbeat table This helps keep the LSN advancing on low-traffic databases: 1. Create the heartbeat table:
Copy code
CREATE TABLE public.airbyte_heartbeat (
    id SERIAL PRIMARY KEY,
    timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp,
    text TEXT
);
2. Add it to your publication:
Copy code
ALTER PUBLICATION <publicationName> ADD TABLE public.airbyte_heartbeat;
3. In the Postgres source connector UI, under Advanced → Debezium heartbeat query, enter:
Copy code
INSERT INTO public.airbyte_heartbeat (text) VALUES ('heartbeat');
[WAL disk consumption; CDC LSN issue] Option D: Change "Invalid CDC position behavior" to "Re-sync data" In the connector's advanced settings, switching from Fail sync to Re-sync data will allow the sync to recover via a full refresh, though this is not ideal for large tables and the error may recur. [CDC LSN issue] ------------------------- Summary: Since your WAL retention settings appear fine, the most likely culprit is the PgJDBC regression introduced in connector versions â‰Ĩ 3.6.19. The cleanest fix is to upgrade to connector version 3.7.2+, or use the heartbeat table workaround in the meantime. 👍 0 button 👎 0 button â„šī¸ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
j
wow major bug, upgrading the connector fixed it