Yuki Kakegawa
10/06/2026, 5:59 PMkapa.ai
10/06/2026, 5:59 PMno progress since last heartbeat [Github Issue (open): [source-postgresql] CDC sync is only allowing WAL to be emptied every two syncs].
2. Configure a Heartbeat Action Query (Recommended Fix) In Postgres logical replication via Debezium, if the tables included in your publication have low or intermittent transaction volumes compared to the rest of the database, the replication slot's confirmed_flush_lsn cannot advance. This causes changes to lag behind and only be flushed when high-activity bursts occur [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
To resolve this, set up a heartbeat mechanism:
1. Create a heartbeat table in your Postgres database:CREATE TABLE airbyte_heartbeat (
id SERIAL PRIMARY KEY,
timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp,
text TEXT
);
2. Add the table to your Airbyte publication:ALTER PUBLICATION publication_name ADD TABLE airbyte_heartbeat;
3. Configure the connector:
In Airbyte, edit your Postgres Source settings under the CDC configuration (Advanced / Optional fields) and add the Debezium heartbeat query:INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat');_(Note: You do not need to sync the airbyte_heartbeat table in your connection catalog)_ [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
3. Verify the Publication and Catalog Alignment Ensure that all tables you intend to sync are actually part of the PostgreSQL publication:
• The Airbyte UI allows selecting tables even if they are not in the publication; however, unincluded tables will not replicate [Documentation Integrations > Sources > Postgres > Cloud SQL for PostgreSQL>].
• Ensure each table has an appropriate replica identity configured:ALTER TABLE table_name REPLICA IDENTITY DEFAULT;_(or REPLICA IDENTITY FULL if tables use TOAST/large column values)_ [Documentation Integrations > Sources > Postgres > Cloud SQL for PostgreSQL>].
4. Increase the Initial CDC Waiting Time If your database generates a high volume of transactions across other tables, the connector may need more time to parse through the WAL before it encounters changes for the tracked tables [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
• If the connector closes before reaching your records, adjust the Initial CDC waiting time in the Postgres source configuration (default is 1200 seconds / 20 minutes; valid range is 120 to 2400 seconds) to allow the connector enough time to read through the change logs [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
5. Check Replication Slot Status and Upgrade Connector Check the replication slot lag directly on your Postgres database:
SELECT slot_name, active, restart_lsn, confirmed_flush_lsn
FROM pg_replication_slots
WHERE slot_type = 'logical';
Ensure that no other process is sharing or reusing the replication slot Airbyte is using [Forum Post: Stack Syncs and Automated Full Resyncs on CDC]. Additionally, ensure you are running the latest version of the Postgres source connector, as several LSN flushing and CDC synchronization bugs were addressed across connector releases [Forum Post: Stack Syncs and Automated Full Resyncs on CDC; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>]. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Yuki Kakegawa
10/06/2026, 7:14 PMkapa.ai
10/06/2026, 7:14 PMconfirmed_flush_lsn cannot advance—even if other parts of the database are constantly writing WAL [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
When this happens:
• Postgres retains more and more WAL files because the slot has not acknowledged an updated LSN [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>; Forum Post: Stack Syncs and Automated Full Resyncs on CDC].
• Airbyte repeatedly filters out records during regular syncs, logging warnings like:Received 10001 events which were all filtered out, so no offset could be committed. This prevents the replication slot from acknowledging the processed WAL offsets...[Forum Post: Stack Syncs and Automated Full Resyncs on CDC].
• Only when a large "burst" of changes finally occurs on the tracked tables does the connector successfully capture enough events to commit the LSN and advance the offset, making it appear as though data is only ingested in occasional bursts [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>; Discuss Forum Post: 3263].
Recommended adjustments: • Set up a Heartbeat Table / Query: This forces regular write events on the publication, ensuring that the connector's LSN advances on every sync and prevents WAL bloat [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
• Increase Initial Waiting Time: In the Postgres source CDC settings, increase initial_waiting_seconds (default is 1200 seconds / 20 minutes) if the connector is timing out before it can process through the backlog of change logs [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>; PostgresSourceConfigurationSpecification.kt]. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Yuki Kakegawa
10/06/2026, 7:15 PMkapa.ai
10/06/2026, 7:15 PMconfirmed_flush_lsn [Forum Post: Stack Syncs and Automated Full Resyncs on CDC]. This causes PostgreSQL to hold onto the WAL files without clearing them, leading to a growing backlog [Forum Post: Stack Syncs and Automated Full Resyncs on CDC].
4. Syncs time out while scanning the backlog:
If WAL is generated faster than the connector can read and discard it, or if the connector reaches its configured waiting time before reaching the tables it cares about, the sync will finish or time out without ingesting any records [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>].
How to address this: • Configure a Heartbeat Query:
Setting up an airbyte_heartbeat table inside your publication and configuring the source connector's Debezium heartbeat query periodically writes tracked events into the WAL [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>]. This forces the replication slot to acknowledge progress and flush the LSN, allowing PostgreSQL to reclaim WAL disk space and preventing the connector from falling behind [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>; Forum Post: Stack Syncs and Automated Full Resyncs on CDC].
• Increase the Initial CDC waiting time:
In the Postgres source CDC settings, increase the waiting time (up to 2400 seconds) so the connector has sufficient time to read through heavy WAL backlogs [Documentation Integrations > Sources > Postgres > Troubleshooting Postgres Sources>]. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Yuki Kakegawa
10/06/2026, 7:19 PMkapa.ai
10/06/2026, 7:19 PMYuki Kakegawa
10/08/2026, 3:12 PMkapa.ai
10/08/2026, 3:12 PMconfirmed_flush_lsn is further ahead in the Write-Ahead Log than the last saved state LSN recorded in Airbyte [Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>; ReplicationSlotManager.kt]. Because the slot has already acknowledged and cleared data past Airbyte's starting point, Airbyte cannot resume from its saved state without risking data loss, causing the validation check to fail [Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>; ReplicationSlotManager.kt].
Here is what causes this and how to resolve it:
Why this happened 1. Impact of the "While reading Data" setting:
The documentation specification for lsn_commit_behaviour explicitly notes:
"If While reading Data is selected, in case of a downstream failure (while loading data into the destination), next sync would result in a full sync." [PostgresSourceConfigurationSpecification.kt]When set to While reading Data, Airbyte continuously flushes and acknowledges the LSN to Postgres while reading records from the WAL, before they are confirmed as committed by the BigQuery destination. If the sync encounters an interruption, timeout, or failure while loading into BigQuery, Postgres has already advanced the replication slot's confirmed_flush_lsn, leaving the Airbyte state file behind [Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>; PostgresSourceConfigurationSpecification.kt].
2. Known connector bugs with LSN advancing:
There have been several reported bugs across source-postgres versions where the connector committed an LSN higher than the saved offset, or where PgJDBC automatically advanced confirmed_flush_lsn even when zero events were ingested for publication tables [Github Issue (closed): [source-postgres] Airbyte Commits the Wrong LSN When Taking the Initial Snapshot; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
Troubleshooting and Resolution Steps 1. Change LSN Commit Behavior back to "After loading Data in the destination" In your Postgres Source settings under the CDC configuration:
• Change LSN commit behavior back to the default: After loading Data in the destination [PostgresSourceConfigurationSpecification.kt].
• This ensures that LSNs are only committed back to Postgres after records have successfully landed in BigQuery, preventing the replication slot from getting ahead of the destination state [PostgresSourceConfigurationSpecification.kt].
2. Recover the Connection State Because the replication slot has moved ahead of the state LSN, the connection cannot resume incrementally as-is [ReplicationSlotManager.kt]. Choose one of the following recovery options:
• Option A: Re-sync data (Recommended)
◦ Change the connection's Invalid CDC position behavior setting from Fail sync to Re-sync Data (or trigger a Reset/Refresh from the UI) [Github Issue (closed): [source-postgres] Airbyte Commits the Wrong LSN When Taking the Initial Snapshot; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
◦ This will re-snapshot the tables and realign Airbyte's state with the slot [Github Issue (closed): [source-postgres] Airbyte Commits the Wrong LSN When Taking the Initial Snapshot; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
• Option B: Manually advance the state LSN (Advanced / Data loss risk)
◦ If you cannot perform a full resync and accept skipping any unread WAL between the two positions, users have worked around this by manually updating the connection state so that Airbyte's state LSN matches the current confirmed_flush_lsn from Postgres [Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
3. Update the Postgres Source Connector Version Check what version of source-postgres you are using:
• Versions between 3.6.19 and 3.7.0 had major known regressions where confirmed_flush_lsn advanced unexpectedly past the saved state [Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>].
• Fixes for these state/LSN alignment issues were introduced in 3.6.34, 3.7.2, and later releases (such as 3.8.x) [Github Issue (closed): [source-postgres] Airbyte Commits the Wrong LSN When Taking the Initial Snapshot; Github Issue (open): [source-postgres] CDC sync is making the confirmed flush LSN to a value saved state LSN>; fix(source-postgres): fix CDC replication slot LSN not advancing]. Upgrading to the latest connector version is recommended. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.