{"record":{"id":"b24a4cace8329b45","repo":"apache/seatunnel","slug":"transaction-was-still-ongoing-while-snapshot-wa","errorCode":null,"errorMessage":"Transaction {} was still ongoing while snapshot was taken, but is no longer completely recorded in the archive logs. Events will be lost. Oldest SCN in logs = {}, TX start SCN = {}","messagePattern":"Transaction (.+?) was still ongoing while snapshot was taken, but is no longer completely recorded in the archive logs\\. Events will be lost\\. Oldest SCN in logs = (.+?), TX start SCN = (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java","lineNumber":308,"sourceCode":"        // was taken.\n        Map<String, Scn> snapshotPendingTransactions =\n                offsetContext.getSnapshotPendingTransactions();\n        if (snapshotPendingTransactions == null || snapshotPendingTransactions.isEmpty()) {\n            // no pending transactions, we can start mining from the snapshot SCN\n            startScn = snapshotScn;\n        } else {\n            // find the oldest transaction we can still fully process, and start from there.\n            Scn minScn = snapshotScn;\n            for (Map.Entry<String, Scn> entry : snapshotPendingTransactions.entrySet()) {\n                String transactionId = entry.getKey();\n                Scn scn = entry.getValue();\n                LOGGER.info(\n                        \"Transaction {} was pending across snapshot boundary. Start SCN = {}, snapshot SCN = {}\",\n                        transactionId,\n                        scn,\n                        startScn);\n                if (scn.compareTo(firstScn) < 0) {\n                    LOGGER.warn(\n                            \"Transaction {} was still ongoing while snapshot was taken, but is no longer completely recorded in the archive logs. Events will be lost. Oldest SCN in logs = {}, TX start SCN = {}\",\n                            transactionId,\n                            firstScn,\n                            scn);\n                    minScn = firstScn;\n                } else if (scn.compareTo(minScn) < 0) {\n                    minScn = scn;\n                }\n            }\n\n            // Make sure the commit SCN is at least the snapshot SCN - 1.\n            // This ensures we'll never emit events for transactions that were complete before the\n            // snapshot was\n            // taken.\n            if (offsetContext.getCommitScn().compareTo(snapshotScn) < 0) {\n                LOGGER.info(\n                        \"Setting commit SCN to {} (snapshot SCN - 1) to ensure we don't double-emit events from pre-snapshot transactions.\",\n                        snapshotScn.subtract(Scn.ONE));","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java#L290-L326","documentation":"computeStartScnForFirstMiningSession detects a transaction that was pending at snapshot time but whose start SCN is below the oldest SCN still present in the archive logs. Its change records have been purged, so those events cannot be mined and will be lost; the connector warns and clamps minScn to firstScn (oldest available log SCN).","triggerScenarios":"During snapshot offset determination a pending TX start SCN < first available archive log SCN — i.e., the archive logs covering the TX start were deleted or the first mining session's start SCN is ahead of the TX start.","commonSituations":"Archive logs removed by RMAN/retention policy while snapshot ran; long-running transactions spanning snapshot and log cleanup; snapshot took so long that redo aged out; insufficient archive log retention for large initial snapshots.","solutions":["Increase archive log retention (RMAN retention policy / db_recovery_file_dest_size) to cover the snapshot duration.","Re-run the snapshot so pending transactions are fully captured within retained logs.","Reduce snapshot duration (increase parallelism) to shrink the pending-TX window.","For known-safe data loss, accept the warning; otherwise restore archived logs from backup before resuming."],"exampleFix":"// before (RMAN)\nCONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;\n// after\nCONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;","handlingStrategy":"validation","validationCode":"-- ensure oldest archived log SCN < any pending TX start SCN\nSELECT min(first_change#) FROM v$archived_log;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Retain archive logs longer than the full snapshot window.","Speed up snapshots to shrink the pending-TX window.","Alert on archive log deletion during initial snapshot."],"tags":["oracle-cdc","logminer","data-loss","archive-logs"],"backgroundTag":"data-loss-detected","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}