Debezium on Oracle: One Idle Transaction, One Log Purge, and a Connector That Can't Resume
The CDC pipeline from Oracle to Kafka has run for weeks with near-zero lag. One night the Debezium task fails: LogFileNotFoundException: None of the log files contain offset SCN: 2303670 after 6 attempts. This could be due to a slow archiver process in the database. Someone restarts it, and it fails again, differently: DebeziumException: The connector is trying to read change stream starting at…
On October 27, 2022, a Debezium task running between Oracle and Kafka experienced a failure due to a transaction that was left idle, resulting in a LogFileNotFoundException. This issue was caused by the archived logs being deleted after the backup, causing the connector to be unable to resume. The Debezium connector fails to read change streams starting at the SCN of the open transaction, as this SCN is no longer available on the server.
To resolve this, the connector needs to be reconfigured to use a snapshot mode. In the lab, the author demonstrated how Debezium decides where to read from and how to find the transaction holding back the connector. A session can remain inactive, causing the connector to fail after a log purge. To prevent this, it is necessary to find the transaction and end it before the logs are purged.
The next step is to perform a snapshot and restart the connector, which will allow it to read every row again as a snapshot event. The purge must be safe for the connector, and it should delete archived logs based on the connector's offset SCN, not only the backup. Additionally, alerting on the gap between the oldest open transaction and the offset SCN is recommended, as well as keeping logs longer than the longest tolerated transaction.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to