<@U04S8PLJWMT> I'm syncing data from aws rds mysql...
# ask-ai
p
@kapa.ai I'm syncing data from aws rds mysql to snowflake via cdc. I have noticed an issue where a delete event was not captured and the snowflake had the record while master db deleted it. I though if airbyte misses a binlog it would give an error preventing next syncs and we have to start from the begining by wiping the data. so I wanna understand how this validation of binlog works. lets assume there are binlogs a,b, and c. airbyte will in 1st sync process a,b,. and now new binlog d is available but c is deleted. now when airbyte checks it doesn't see c but only d. now here, does it continue processing d without giving an error or it gives an error saying binlog c is missing?
k
Based on the knowledge sources, I can explain how Airbyte handles missing binlogs in MySQL CDC replication. When Airbyte detects that a binlog needed for incremental sync has been removed by MySQL, it triggers a full refresh sync from scratch rather than continuing with the next available binlog. According to the [MySQL troubleshooting documentation](https://docs.airbyte.com/integrations/sources/mysql/mysql-troubleshooting#troubleshooting): > "Under CDC incremental mode, there are still full refresh syncs. Normally under the CDC mode, the MySQL source will first run a full refresh sync to read the snapshot of all the existing data, and all subsequent runs will only be incremental syncs reading from the binlogs. However, occasionally, you may see full refresh syncs after the initial run. When this happens, you will see the following log: > > > Saved offset no longer present on the server, Airbyte is going to trigger a sync from scratch > > The root causes is that the binglogs needed for the incremental sync have been removed by MySQL." So in your scenario where binlogs a, b, c, and d exist, and Airbyte processes a and b in the first sync, if binlog c is deleted before the next sync, Airbyte will detect that the saved offset (binlog c) is no longer present and will trigger a full refresh sync from scratch rather than skipping to binlog d. However, regarding your specific issue where a delete event was not captured, this appears to be a known problem. There are several GitHub issues documenting similar problems with MySQL CDC missing delete events or UPDATE events: - [Missing data during replication of big tables](https://github.com/airbytehq/airbyte/issues/48717) - [MySQL CDC connector misses UPDATE events](https://github.com/airbytehq/airbyte/issues/60811) - [MySql CDC to Snowflake sync issue](https://github.com/airbytehq/airbyte/issues/57542) The knowledge sources suggest that while Airbyte should detect missing binlogs and trigger a full refresh, there may be edge cases or bugs where certain CDC events (including deletes) are not properly captured, particularly with large tables or high-volume changes. To prevent binlog expiration issues, the documentation recommends: - Syncing more frequently - Increasing
binlog_expire_logs_seconds
for standard MySQL installations - For Amazon RDS MySQL, setting
binlog retention hours
to at least 24 hours using
call mysql.rds_set_configuration('binlog retention hours', 24);
p
@kapa.ai I have set 8 hours of binlong retention and sync runs every 2 hours. So the issue happend under these settings.
k
A message from kapa.ai
Based on your configuration (8 hours binlog retention with syncs every 2 hours), you should have sufficient buffer to prevent binlog expiration issues. This suggests the delete event not being captured is likely due to a different issue rather than missing binlogs. The knowledge sources document several known bugs related to CDC missing events even when binlogs are properly retained: 1. MySQL CDC Missing Events Bug: The [MySQL CDC connector issue](https://github.com/airbytehq/airbyte/issues/60811) specifically mentions that "certain UPDATEs in the binlog are never applied - Airbyte advances its pointer without error and the record remains stale downstream." This indicates that Airbyte can sometimes skip events while still advancing its binlog position without triggering an error. 2. Missing Deletions in Postgres CDC: A similar issue was reported in the [forum post about missing deletions](https://discuss.airbyte.io/t/4193), where users experienced missing deletions despite proper CDC configuration. The issue became more frequent with higher sync frequencies and larger change volumes. 3. CDC Sync Issues: The [MySql CDC to Snowflake sync issue](https://github.com/airbytehq/airbyte/issues/57542) documents cases where the final table doesn't reflect the latest CDC changes, with older records being retained instead of newer ones. Given your setup with adequate binlog retention, the most likely explanation is that you're encountering one of these known CDC bugs where Airbyte processes the binlog but fails to properly apply certain delete events to the destination, even though it advances its position without error. This is particularly concerning because, as you correctly noted, the system doesn't trigger a full refresh in these cases - it simply continues with incomplete data. I recommend monitoring your sync logs for any warnings or errors, and consider reporting this as a bug to the Airbyte team if you can reproduce the issue consistently.