<@U04S8PLJWMT> Hi, why does manual resync result i...
# ask-ai
c
@kapa.ai Hi, why does manual resync result in the 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.
k
The 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” occurs because the Write-Ahead Logs (WAL) required for Change Data Capture (CDC) incremental sync have been removed by Postgres before Airbyte could read them. This typically happens in these scenarios: - WAL Retention Too Low: If there are many updates in your database, Postgres may purge or archive WAL files to free up space. If Airbyte’s sync does not run frequently enough, or if the WAL retention settings (
wal_keep_size
,
max_slot_wal_keep_size
) are too low, the WAL segments needed for incremental sync may be deleted before Airbyte can process them. - Sync Frequency Too Low: If the interval between syncs is longer than the WAL retention period, the required WAL files may be gone by the time the next sync runs. - Manual Resync or Slot Recreation: If you manually reset the connection or recreate the replication slot, the saved offset in Airbyte’s state may point to an LSN (Log Sequence Number) that is no longer available in the replication slot, triggering this error. How to resolve and prevent this: - Increase WAL retention: Set a higher value for
wal_keep_size
and/or
max_slot_wal_keep_size
in your Postgres configuration to retain WAL files longer. - Increase sync frequency: Run Airbyte syncs more frequently so that WAL files are consumed before they are purged. - Reset the connection: As the error suggests, you may need to reset the connection to re-align the state, but this will trigger a full refresh. For more details and troubleshooting steps, see the official Airbyte documentation: [Troubleshooting Postgres Sources](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs) and related GitHub issues where this behavior is discussed in detail [source](https://github.com/airbytehq/airbyte/issues/46571). Summary: This error is a result of a mismatch between the saved offset and the available WAL files in Postgres. Adjusting WAL retention and sync frequency are the recommended solutions.
c
@kapa.ai Okay, tell me why the synchronization is so long, there are 2 MB of data
k
A message from kapa.ai
There are several user reports and discussions indicating that Airbyte syncs can take a long time even when the data volume is very small (e.g., 2 MB). The main reasons identified in the knowledge sources are: 1. Overhead from Managing Many Connections and Tables: Even if each table or connection has little data, having a large number of connections (e.g., 50 connections with 300 tables each) creates significant overhead. Airbyte must manage metadata, orchestration, and resource allocation for each connection, which can slow down the overall process. This overhead can be substantial compared to the actual data transfer time for small datasets. Users have reported syncs taking hours for small data volumes in such scenarios, especially when scaling up the number of connections or workers leads to resource exhaustion or failures [Airbyte taking too much resources and Time](https://discuss.airbyte.io/t/995). 2. Resource Constraints and Configuration: If CPU or RAM resources are limited, or if the Airbyte instance is not optimally configured (e.g., not enough workers, or the Airbyte database is not on a dedicated instance), syncs can be slow. Increasing CPU and memory, and tuning environment variables related to job scaling, can help improve performance, but there are limits to how much this helps with many small jobs [Airbyte taking too much resources and Time](https://discuss.airbyte.io/t/995). 3. Job Orchestration and Queuing: Airbyte’s job system may queue jobs if there are not enough available workers, leading to delays even for small syncs. This is especially noticeable when running many connections in parallel or when the system is under heavy load [Is Marketo Sync Supposed to Take Hours?](https://discuss.airbyte.io/t/984). 4. Internal Data Representation: Airbyte converts data to JSON internally, which can increase the size and processing time, even for small source files. This conversion and the associated metadata can add overhead to the sync process [Every sync double the raw table sizes](https://discuss.airbyte.io/t/1579). In summary: Syncs can be slow for small data volumes due to orchestration overhead, resource constraints, job queuing, and internal data processing. This is a known limitation, especially when managing many connections or tables, and is not always directly related to the amount of data being transferred.
c
@kapa.ai 506 extracted | 19m elapsed What do you mean, data is being transferred? or is it already in the cluster?
k
A message from kapa.ai
When you see a sync status like “506 extracted | 19m elapsed” in Airbyte, it means that Airbyte has read (extracted) 506 records from the source, and 19 minutes have passed since the sync started. During this time, the data is being processed through several stages: - Extraction: Airbyte reads data from the source system. - Transfer: The extracted data is serialized (converted to JSON) and sent to the Airbyte platform, and then to the destination. - Loading: The data is written (loaded) into the destination system. So, “extracted” refers to the number of records Airbyte has read from the source, but it does not necessarily mean all those records have already been loaded into the destination. The data may still be in transit or being processed, depending on the sync’s progress. The elapsed time shows how long the sync has been running, not how long the data has been in the destination. You can monitor the number of records read (extracted) and the number of records loaded (committed to the destination) in the Airbyte UI. These metrics help you understand where the sync is in the process and whether data is still being transferred or has already arrived in the destination [Review the Connection Timeline](https://docs.airbyte.com/platform/next/cloud/managing-airbyte-cloud/review-connection-timeline#syncs-refreshes-and-clears). If you see a large elapsed time with a small number of records extracted, it may indicate a bottleneck in extraction, transfer, or loading, or possibly an issue with the source or destination system’s performance.
c
@kapa.ai Why synchronize a long visit to the queue?
k
A message from kapa.ai
A long wait in the Airbyte sync queue usually happens when there are not enough available resources (such as worker pods, CPU, or memory) to start new sync jobs. This can be caused by: - Resource Constraints: If your Airbyte deployment does not have enough CPU, memory, or worker pods, jobs will be queued until resources are free. This is common when running many connections or large syncs in parallel [Airbyte taking too much resources and Time](https://discuss.airbyte.io/t/995), [Syncs taking almost an hour for <20kb of data](https://discuss.airbyte.io/t/3780). - Worker Configuration: The number of concurrent syncs is controlled by settings like
MAX_SYNC_WORKERS
and the number of Airbyte worker replicas. If these are set too low for your workload, jobs will wait in the queue [Syncs taking almost an hour for <20kb of data](https://discuss.airbyte.io/t/3780). - Job Orchestration Overhead: Airbyte’s orchestration system may introduce delays, especially if there are many jobs or connections. Even small syncs can be delayed if the system is busy [Is Marketo Sync Supposed to Take Hours?](https://discuss.airbyte.io/t/984). In summary, long queue times are typically due to limited resources or configuration limits on parallelism. Increasing available resources or tuning worker settings can help reduce queue times.
c
@kapa.ai как изменить значение
MAX_SYNC_WORKERS
k
A message from kapa.ai
Чтобы изменить значение
MAX_SYNC_WORKERS
в Airbyte, вам нужно задать соответствующую переменную окружения для worker'ов. В зависимости от способа развертывания (например, через Helm chart), это делается в файле
values.yaml
. Пример для Helm chart:
Copy code
yaml worker:   env_vars:     MAX_SYNC_WORKERS: 12     MAX_CHECK_WORKERS: 12
Или для некоторых версий Helm chart:
Copy code
yaml worker:   extraEnv:     - name: MAX_SYNC_WORKERS       value: "12"     - name: MAX_CHECK_WORKERS       value: "12"
После изменения значения переменной окружения, перезапустите соответствующие pods, чтобы изменения вступили в силу. Обратите внимание, что точный синтаксис зависит от версии Helm chart и вашей конфигурации. Подробнее см. в официальной документации и обсуждениях пользователей ([Scaling Airbyte After Installation](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte), [Support the MAX_*_WORKERS environment variables in the Helm chart](https://github.com/airbytehq/airbyte/issues/29547)).
c
@kapa.ai Дай пример файла values.yaml
k
A message from kapa.ai
Вот пример файла
values.yaml
для настройки количества воркеров (
MAX_SYNC_WORKERS
и
MAX_CHECK_WORKERS
) в Airbyte через Helm chart V2:
Copy code
yaml worker:   maxSyncWorkers: 12   maxCheckWorkers: 12   replicaCount: 2
Если вы используете Helm chart V1, переменные задаются через `extraEnv`:
Copy code
yaml worker:   extraEnv:     - name: MAX_SYNC_WORKERS       value: "12"     - name: MAX_CHECK_WORKERS       value: "12"   replicaCount: 2
Для Helm chart V2 рекомендуется использовать camelCase ключи, как показано выше. Полный пример и список изменений между версиями Helm chart можно найти в официальной документации [Scaling Airbyte After Installation](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte), [Update your values.yaml file](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#update-your-valuesyaml-file). Важно: - После изменения файла
values.yaml
примените изменения командой
helm upgrade
. - Точный синтаксис зависит от вашей версии Helm chart. - Для других параметров и примеров смотрите [values.yaml на GitHub](https://github.com/airbytehq/airbyte-platform/blob/main/charts/v2/airbyte/values.yaml).