why is _ab_cdc_deleted_at empty for deleted rows? ...
# ask-ai
s
why is _ab_cdc_deleted_at empty for deleted rows? @kapa.ai
k
The _ab_cdc_deleted_at field is specifically designed to capture the timestamp of a DELETE operation in Change Data Capture (CDC) mode. When a row is deleted in the source database, Airbyte should populate _ab_cdc_deleted_at with the timestamp of the deletion in the raw and history tables. If you are seeing _ab_cdc_deleted_at as empty (i.e., NULL) for deleted rows, this is not the expected behavior. Here are some possible reasons, based on the knowledge sources: 1. CDC Not Properly Enabled or Configured: If CDC is not correctly set up on the source database or the table, Airbyte may not be able to capture DELETE events, resulting in _ab_cdc_deleted_at being empty. Make sure CDC is enabled and configured for the relevant tables, and that the modifications are made using DELETE/INSERT/UPDATE statements (not TRUNCATE/ALTER, which are not captured) [CDC documentation](https://docs.airbyte.com/platform/understanding-airbyte/cdc#limitations). 2. Connector or Airbyte Version Issues: There have been known bugs in earlier versions of Airbyte and some connectors where deleted rows were not properly reflected in the destination, or _ab_cdc_deleted_at was not set. For example, users have reported that upgrading Airbyte or downgrading the connector version resolved the issue ([forum post](https://discuss.airbyte.io/t/1653), [forum post](https://discuss.airbyte.io/t/461)). 3. Destination Transformation Logic: In some cases, the raw table may correctly show _ab_cdc_deleted_at, but the final (deduplicated) table does not, because the transformation logic is not handling deletes as expected. This was a known issue in some Airbyte versions and was fixed in later releases ([forum post](https://discuss.airbyte.io/t/461)). 4. Database-Specific Limitations: There may be database-specific limitations or misconfigurations that prevent DELETE events from being captured. Always check the documentation for your specific source connector. Expected Behavior: When a row is deleted, the raw table should contain a new entry for that row with _ab_cdc_deleted_at set to the deletion timestamp. The final deduplicated table will not show the deleted row, as intended. If _ab_cdc_deleted_at is empty for deleted rows, it usually indicates a configuration or version issue, not the intended CDC behavior [CDC tutorial](https://airbyte.com/tutorials/incremental-change-data-capture-cdc-replication). Summary: _ab_cdc_deleted_at should not be empty for deleted rows. If it is, check your CDC configuration, Airbyte and connector versions, and review any known issues for your database and destination. Upgrading to the latest stable versions often resolves these issues.
s
it is happening with mysql source using cdc binlog.. deleted_at is coming correctly with stitchdata but not with airbyte @kapa.ai
k
A message from kapa.ai
If _ab_cdc_deleted_at is not being populated for deleted rows when using Airbyte's MySQL CDC (binlog) source, but works as expected with StitchData, this is not the intended behavior for Airbyte. According to Airbyte's documentation and tutorials, when CDC is properly configured, deleted rows should have _ab_cdc_deleted_at set to the timestamp of the deletion. This is confirmed in the official MySQL CDC tutorial, which states: > CDC allows you to see that a row was deleted, which would be impossible to detect when using the regular Incremental sync mode. The _ab_cdc_deleted_at meta field not being null means id=3 was deleted. [MySQL CDC Tutorial](https://airbyte.com/tutorials/mysql-change-data-capture-cdc#step-7) If you are not seeing _ab_cdc_deleted_at populated in Airbyte, but it works in StitchData, possible causes include: - Connector or Airbyte Version Issue: There have been known bugs in earlier Airbyte versions or connector versions where deletes were not handled correctly. Upgrading to the latest version of Airbyte and the MySQL connector is recommended. - CDC Configuration Issue: Ensure that the MySQL binlog is enabled and configured correctly, and that the Airbyte connection is set to use CDC mode. - Transformation/Normalization Issue: Sometimes the raw table may have the correct _ab_cdc_deleted_at value, but the normalized or final table does not, due to transformation logic issues. The knowledge sources do not provide a specific bug report for this exact issue with the MySQL CDC source, but they do confirm that _ab_cdc_deleted_at should be present for deleted rows if CDC is working as intended. If you are on a recent version and still experiencing this, it may be a bug or a configuration issue specific to your setup. Recommendation: - Double-check your MySQL binlog and Airbyte CDC configuration. - Ensure you are using the latest Airbyte and MySQL connector versions. - If the issue persists, consider opening a GitHub issue with Airbyte, as this is not the expected behavior according to the documentation and tutorials. References: - [MySQL CDC Tutorial](https://airbyte.com/tutorials/mysql-change-data-capture-cdc#step-7) - [CDC Documentation](https://docs.airbyte.com/platform/understanding-airbyte/cdc)