<@U04S8PLJWMT> I have an airbyte pipeline running ...
# ask-ai
p
@kapa.ai I have an airbyte pipeline running syncing data from mysql rds to Snowflake. This sync is based on CDC(binlog). We are currently keeping binlog retention in AWS to 10 hours, and we cannot increase beyond this. A sync in airbyte take around less than 2 hours, so multiple syncs occurs within 10 hour window therefore currently sync is running ok. However, if some error occurred and if we couldn't fix it within this 10 hour timeframe, binlog would be lagging behind and the airbyte will complain the data are missing from binlog and require to do a full sync. This would be very costly and takes a lot of time, and we couldn't afford that. Is there a solution for this so we don't have to do a full sync since that is costly. We went with cdc in first place because it captures delete events and keeps the 2 databases in-sync incrementally which is very performant optimized..
k
Your concern is valid: if Airbyte loses access to the required MySQL binlogs (due to the 10-hour retention window expiring before the sync can resume), it will be forced to perform a full refresh sync. This is a known limitation of log-based CDC replication in Airbyte and other similar tools. Why this happens: Airbyte tracks the last processed binlog position. If, due to an error or downtime, the next sync starts after the binlog containing the last processed position has been purged, Airbyte cannot resume from the correct point. In this case, it will log an error like: > Saved offset no longer present on the server, Airbyte is going to trigger a sync from scratch and will require a full refresh to re-establish a consistent state between source and destination. This is described in the troubleshooting documentation for MySQL sources in Airbyte: > The root causes is that the binlogs needed for the incremental sync have been removed by MySQL. This can occur under the following scenarios: > - When there are lots of database updates resulting in binary log files expiring before a sync could be made. This scenario is preventable. Possible solutions include: > - Sync the data source more frequently. > - For standard MySQL installations: Set a higher
binlog_expire_logs_seconds
. > - For Amazon RDS MySQL instances: Set the
binlog retention hours
parameter to at least 24 hours (or higher). > - The downside of increasing retention is that more disk space is needed. > [Troubleshooting MySQL Sources](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting) Your situation: Since you cannot increase the binlog retention beyond 10 hours, and your syncs are currently running well within that window, you are protected as long as no sync is delayed beyond 10 hours. However, if a sync fails and cannot be fixed within that window, there is no built-in way in Airbyte to avoid a full refresh—the binlog data will be lost, and incremental CDC cannot resume. Possible mitigations (from Airbyte documentation and community): - Increase sync frequency: Run syncs more frequently to minimize the risk window. This is already your current approach. - Monitor sync health: Set up monitoring and alerting to detect sync failures immediately, so you can respond before the binlog window expires. - Manual intervention: In some cases, advanced users have tried to manually update the Airbyte state to a newer binlog position, but this is risky and not officially supported. It can lead to data loss or inconsistency if not done correctly. - No official solution to skip full refresh: There is currently no supported way in Airbyte to "skip" the full refresh and start CDC from the current binlog position (i.e., a "new changes only" mode for MySQL, as exists for some other connectors). This feature has been requested by users but is not available yet ([Syncing huge tables (10B+ rows) from MySQL](https://discuss.airbyte.io/t/3783), [GitHub Issue #20112](https://github.com/airbytehq/airbyte/issues/20112)). Summary: Given your constraints, the only way to avoid a full refresh is to ensure that no sync is delayed beyond the binlog retention window. There is no built-in Airbyte feature to resume CDC from the current binlog position if the previous position is lost. If this is a critical requirement, you may want to follow or contribute to the feature requests for "new changes only" CDC mode for MySQL, but as of now, this is not available. If you need more details or want to discuss possible workarounds, let me know!
p
@kapa.ai ok. the main point for using cdc(binlog) based sync is that it deleted records in destination that are already deleted in source, keeping the both in-sync. Is there an alternative approach(without using CDC) that will do the same?
@kapa.ai the main point for using cdc(binlog) based sync is that it deleted records in destination that are already deleted in source, keeping the both in-sync. Is there an alternative approach(without using CDC) that will do the same?
k
A message from kapa.ai
No, according to the knowledge sources, there is no alternative approach in Airbyte (without using CDC) that will automatically propagate deletions from the source to the destination and keep both in sync. Standard incremental sync in Airbyte does not capture or propagate deleted records. When using incremental sync, only new or updated records are replicated; deleted records in the source remain in the destination and are not removed or flagged. This is a well-documented limitation: > ...when using incremental synchronization, due to the manner in which records are selected for replication, deleted records are not propagated to the destination. If incremental replication is used, it may be feasible to propagate delete operations by making use of soft deletes. Alternatively, Change Data Capture (CDC) replication may be considered as an alternative to incremental synchronization, as it ensures that deletions are propagated from the source to the destination correctly [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-8). > The inability to directly propagate deleted records is one of the main disadvantages of incremental synchronization. This occurs because the records that are replicated to the destination are selected by a query on the source system for records that have been inserted or modified since the last synchronization. Any records that have been deleted are not returned by such a query, and therefore deleted records are not propagated to the destination. Two common ways to address this shortcoming are CDC replication, or by making use of soft deletes [Explore Airbyte’s incremental data synchronization](https://airbyte.com/tutorials/incremental-data-synchronization#step-7). Full refresh overwrite is the only non-CDC method that will ensure the destination matches the source, including deletions, but it is not incremental and is costly for large datasets. Soft deletes (adding a "deleted" flag in your source data) can be used as a workaround, but this requires changes to your data model and application logic. Summary: - Only CDC-based sync in Airbyte will propagate deletes from source to destination. - Incremental sync does not handle deletes. - Full refresh overwrite will match source and destination but is not incremental. - Soft deletes are a possible workaround but require changes outside Airbyte. For your use case—keeping source and destination in sync including deletions—CDC is the recommended and only supported approach in Airbyte according to the current documentation and tutorials [Explore Airbyte's Change Data Capture (CDC) synchronization](https://airbyte.com/tutorials/incremental-change-data-capture-cdc-replication), [Forum: Sync of Deleted records in source to the target datasource](https://discuss.airbyte.io/t/372).