Cédric Hauvieux
08/21/2025, 7:41 AMwal_level = logical
wal_keep_size = 1GB
max_wal_senders = 1
max_replication_slots = 1
wal_sync_method = fsync
synchronous_commit = on
min_wal_size = 80MB
max_wal_size = 1GB
Let me know if you need more details or have any questions.kapa.ai
08/21/2025, 7:42 AMconfirmed_flush_lsn can move ahead of the last saved offset. - Low Transaction Volume: If there are few or no changes in the tables being tracked, the WAL may not advance as expected, and PostgreSQL may clean up WAL segments that Airbyte still needs for CDC, causing the offset mismatch and triggering a full resync or failure. ### Your Configuration Your current WAL-related settings are: plaintext wal_level = logical wal_keep_size = 1GB max_wal_senders = 1 max_replication_slots = 1 wal_sync_method = fsync synchronous_commit = on min_wal_size = 80MB max_wal_size = 1GB - wal_keep_size = 1GB is reasonable, but in low-traffic environments, the issue is not just about size, but also about the frequency of WAL advancement. - max_replication_slots = 1 and max_wal_senders = 1 are minimal; if you have more than one replication client, you may need to increase these. ### Solutions #### 1. Increase WAL Retention - You can try increasing wal_keep_size further, but this only helps if the WAL is filling up. In low-traffic environments, this may not be sufficient. #### 2. Increase Sync Frequency - Run Airbyte syncs more frequently to ensure the WAL segments needed for CDC are not removed before Airbyte can read them. However, you mentioned that even with five-minute intervals, the issue eventually appeared. #### 3. Heartbeat Table (Recommended for Low-Traffic Databases) - Create a heartbeat table and add it to your publication. Airbyte (via Debezium) can be configured to periodically write to this table, ensuring the WAL advances even when there are no changes in your main tables. - Steps: 1. Create the table: sql CREATE TABLE airbyte_heartbeat ( id SERIAL PRIMARY KEY, timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp, text TEXT ); 2. Add it to your publication: sql ALTER PUBLICATION <publicationName> ADD TABLE airbyte_heartbeat; 3. In Airbyte, set the Debezium heartbeat query to: sql INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat'); This will keep the WAL advancing and prevent the offset mismatch error, as described in the [Airbyte documentation](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query). #### 4. Check for Known Connector Issues - There are known issues with certain versions of the Airbyte Postgres source connector and the underlying PgJDBC driver, which can cause similar problems even if your WAL settings are correct. If you are using a connector version >= 3.6.19, you may be affected by a bug where the confirmed_flush_lsn advances unexpectedly. Downgrading to version 3.6.18 or earlier may help as a temporary workaround. See [this issue](https://github.com/airbytehq/airbyte/issues/49802) for more details. ### Summary - Add a heartbeat table and configure Airbyte to use it. - Consider increasing wal_keep_size further if disk space allows. - Ensure your Airbyte and connector versions are not affected by known bugs. - Increase sync frequency if possible, but the heartbeat table is the most robust solution for low-traffic databases. For more details and step-by-step instructions, refer to the [Airbyte Postgres troubleshooting guide](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query). If you need further help, please provide your Airbyte and connector versions, and confirm if you are using a heartbeat table or not.Cédric Hauvieux
08/21/2025, 8:35 AM-- Étape 1: Créer la table airbyte_heartbeat si elle n'existe pas déjà
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM information_schema.tables
WHERE table_schema = current_schema()
AND table_name = 'airbyte_heartbeat'
) THEN
CREATE TABLE airbyte_heartbeat (
id SERIAL PRIMARY KEY,
timestamp TIMESTAMP NOT NULL DEFAULT current_timestamp,
text TEXT
);
END IF;
END $$;
-- Étape : Insérer une entrée dans la table airbyte_heartbeat pour initialiser le heartbeat
INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat')kapa.ai
08/21/2025, 8:41 AMkapa.ai
08/21/2025, 8:41 AMINSERT or UPDATE, not for DDL or procedural code like DO $$ ... $$ blocks or CREATE TABLE statements. The documentation and user reports indicate that the heartbeat query should be a straightforward statement that writes to an existing table, for example: sql INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat'); or sql UPDATE yourSchema.yourTable SET value='heartbeat', updated=now(); You must create the airbyte_heartbeat table manually in your database before configuring the heartbeat query in Airbyte. The heartbeat query will then periodically write to this table to keep the WAL advancing and prevent CDC issues in low-traffic environments. This process is described in the [Airbyte documentation](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query) and confirmed by user experiences in the community and GitHub issues. Summary: - The heartbeat query field does not support DDL or procedural code. - Create the table manually first, then use a simple DML statement as the heartbeat query. For more details, see the official [Airbyte Postgres troubleshooting guide](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query) and related user discussions in the knowledge sources.Cédric Hauvieux
08/21/2025, 8:45 AMINSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat')
should I add ; at the end like so ? :
INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat');kapa.ai
08/21/2025, 8:45 AMkapa.ai
08/21/2025, 8:45 AM;) at the end of the query in the Debezium heartbeat query field. The documentation and examples provided by Airbyte show the query without a semicolon: INSERT INTO airbyte_heartbeat (text) VALUES ('heartbeat') This is the recommended format to use in the Airbyte UI for the Debezium heartbeat query property. Adding a semicolon is not necessary and could potentially cause issues, as the field expects a single SQL statement without statement terminators. Reference: [Airbyte Postgres troubleshooting guide](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query)