Hi Airbyte Community, I’m seeing a replication pr...
# replication-troubleshooting
w
Hi Airbyte Community, I’m seeing a replication problem with Airbyte CDC and want to understand best practice / root cause. Summary and concrete questions below. Environment / facts • Source: Postgres (Cloud SQL).
cloudsql.enable_pglogical
and
cloudsql.logical_decoding
are enabled. • Destination: Postgres (Cloud SQL) - user used in destination profile have required previledeges • Postgres config:
max_wal_size = 40960
(MB),
max_wal_senders = 20
. • Airbyte is the consumer. I have two replication slots/publications with two different tables in each along with separate heartbeat table, in the same source database → same Airbyte instance (one Airbyte connection currently configured for both tables). • I do not have
pg_cron
extension installed or added to
shared_preload_libraries
. • I use two heartbeat tables (one per Airbyte source). • Table sizes at source: ◦
table1
≈ ~400,000 rows (but pg stats show heavy cumulative churn) ◦
table2
≈ ~40,000 rows • The tables experience inserts and deletes (high churn on
table1
). Observed behavior • I can run incremental CDC and clear data for
table2
successfully. • For
table1
, incremental CDC + clear data gets stuck. While trying to clear data I see continuous minute-interval destination logs like:
Copy code
2025-10-07 18:05:08 destination INFO pool-3-thread-1 i.a.c.i.d.a.b.BufferManager(printQueueInfo):89 [ASYNC QUEUE INFO] Global: max: 296.96 MB, allocated: 10 MB (10.0 MB), %% used: 0.03367428551701215 | State Manager memory usage: Allocated: 10 MB, Used: 0 bytes, percentage Used 0.0
2025-10-07 18:05:08 destination INFO pool-6-thread-1 i.a.c.i.d.a.FlushWorkers(printWorkerInfo):127 [ASYNC WORKER INFO] Pool queue size: 0, Active threads: 0
2025-10-07 18:06:08 destination INFO pool-3-thread-1 i.a.c.i.d.a.b.BufferManager(printQueueInfo):89 ...
2025-10-07 18:06:08 destination INFO pool-6-thread-1 i.a.c.i.d.a.FlushWorkers(printWorkerInfo):127 ...
(These log lines repeat every minute while the Incremental append + dedupe/clear operation is “stuck”.) Questions — please advise 1. Single replication slot for two CDC tables ◦ Is it safe / recommended to use a single replication slot / publication for both CDC tables when both use
REPLICA IDENTITY DEFAULT
? ◦ Will using one slot for both tables cause any LSN confusion for Airbyte when catching the “last commit” for each table, or can Airbyte maintain per-table offsets correctly (given the slot tracks only the global LSN)? 2. REPLICA IDENTITY DEFAULT ◦ Both tables have primary keys. Is
REPLICA IDENTITY DEFAULT
the right setting for deletes here, or do you recommend
REPLICA IDENTITY FULL
for more reliable CDC when deletes occur frequently? 3. Why clear data/incremental CDC are stuck for
table1
only
◦
table2
clears fine.
table1
is heavy churn (pg stats show very large cumulative inserts/deletes while current row count ≈ 400k). Could the high churn alone explain the stuck behavior? 4. Continuous minute logs during clear ◦ Why does Airbyte emit the
BufferManager
/
FlushWorkers
info every minute while the clear data operation is stuck? Is it an indication of a heartbeat, stalled buffers, internal retries, or backpressure? How should I interpret these periodic lines and which internal component of Airbyte do they indicate is waiting? 5. Practical recommendations • Given my configuration and workloads, would you recommend: ▪︎ Splitting
table1
into its own Airbyte connection/publication/slot to isolate WAL accumulation? ▪︎ Any Airbyte source connector configuration (batch size, queue size, initial waiting time, etc) to make CDC/clear operations complete? Helpful information I can provide on request • current
pg_replication_slots
output (slot name, active, restart_lsn, confirmed_flush_lsn) •
pg_publication
and
pg_publication_tables
outputs • exact Airbyte connector config settings for source/dest Thanks in advance
👀 1
k
Certainly! Here’s a focused response to your questions, based strictly on the available Airbyte documentation and community knowledge: --- ### 1. Single Replication Slot for Two CDC Tables It is supported and common to use a single replication slot and publication for multiple tables in Airbyte CDC, as long as all tables are included in the publication. Airbyte tracks the global LSN (Log Sequence Number) from the slot and maintains per-stream (table) offsets internally. There is no indication in the documentation that this setup would cause LSN confusion for Airbyte, provided the slot is dedicated to Airbyte and not shared with other consumers. However, ensure that all tables you wish to replicate are included in the publication; otherwise, changes to excluded tables will not be captured or may cause issues if selected in Airbyte but not present in the publication. If a table is selected in Airbyte but not in the publication, it will not be replicated, even if selected in the UI. If a table is in the publication but lacks a replication identity, Airbyte will attempt to set it automatically if permissions allow [Cloud SQL CDC Setup](https://docs.airbyte.com/integrations/sources/postgres/cloud-sql-postgres#step-5-create-publication-and-replication-identities-for-each-postgres-table). --- ### 2. REPLICA IDENTITY DEFAULT vs FULL For tables with a primary key,
REPLICA IDENTITY DEFAULT
is generally sufficient and is the recommended setting in Airbyte’s documentation. Only consider
REPLICA IDENTITY FULL
if your tables use data types that support TOAST (very large fields) or if you encounter issues with deletes not being captured as expected [Cloud SQL CDC Setup](https://docs.airbyte.com/integrations/sources/postgres/cloud-sql-postgres#step-5-create-publication-and-replication-identities-for-each-postgres-table). --- ### 3. Why Clear Data/Incremental CDC Are Stuck for
table1
Only High churn (frequent inserts/deletes) can cause issues, especially if WAL (Write-Ahead Log) segments accumulate faster than Airbyte can process them, or if the destination cannot keep up, leading to backpressure. The documentation and community reports indicate that large or high-churn tables can cause slow ingestion or even stuck jobs, particularly if the destination is slow to flush data or if there are too many tables in a single connection [Forum: CDC connector stuck](https://discuss.airbyte.io/t/4373). Limiting the number of tables per connection and tuning buffer parameters can help. --- ### 4. Continuous Minute Logs During Clear The repeated
BufferManager
and
FlushWorkers
logs indicate that Airbyte’s destination is reporting on its internal buffer and worker status. This is typically a sign of backpressure: the source is producing data faster than the destination can consume it, or the destination is waiting for some condition to proceed (e.g., waiting for a batch to fill, or for a flush to complete). These logs are not heartbeats but are periodic status reports. If the job is stuck here, it often means the destination is not able to keep up, possibly due to large data volumes, slow disk, or suboptimal configuration [Forum: CDC connector stuck](https://discuss.airbyte.io/t/4373). --- ### 5. Practical Recommendations - Splitting Connections: Yes, splitting high-churn tables (like
table1
) into their own Airbyte connection, publication, and replication slot is recommended. This isolates WAL accumulation and can improve performance and reliability [Forum: CDC connector stuck](https://discuss.airbyte.io/t/4373). - Connector Configuration: - Limit the number of tables per connection (ideally ≤30 for CDC jobs). - Increase buffer parameters in the destination (e.g., set Snowflake buffer to 50 if using Snowflake). - Use staging on the destination if supported. - For low-traffic tables, ensure heartbeat events are configured to advance the LSN and avoid WAL bloat [Heartbeat Query](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#advanced-wal-disk-consumption-and-heartbeat-action-query). - If you have high-churn tables, consider more frequent syncs to avoid WAL segment loss and forced full refreshes [Troubleshooting](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#troubleshooting). --- If you continue to see stuck jobs, please provide the output of
pg_replication_slots
,
pg_publication
, and connector settings for deeper analysis.
--- Summary: - Using a single slot/publication for multiple tables is supported if all are included in the publication. -
REPLICA IDENTITY DEFAULT
is fine for tables with primary keys. - High churn can cause stuck jobs due to backpressure or WAL accumulation. - The periodic logs indicate buffer/destination status, likely due to backpressure. - Split high-churn tables into separate connections/slots, tune buffer sizes, and limit tables per connection for best results. If you need more specific tuning advice, please share your connector configs and relevant Postgres outputs.
w
I need 1-to-1 help
m
Hi @Wasim Bagwan, just wondering since we did Airbyte<>Postgres CDC setup not long ago. Did you encounter this issue?
Copy code
Failure in source: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future
or any LSN desync related issue?
w
HI @Manuel Pozo Sometimes I encounter this issue
Failure in source: Saved offset is not valid. Please reset the connection, and then increase oplog retention and/or increase sync frequency to prevent his from happening in the future
or LSN desync related issue if by mistake connection/s is/are disabled or due to some unavoidable reasons connection/s has/have to be stopped. But in those scenarios, we just do full refresh for such connection/s again.