{"record":{"id":"9a11d117b09abb3c","repo":"apache/seatunnel","slug":"snapshot-was-interrupted-before-completion-9a11d1","errorCode":null,"errorMessage":"Snapshot was interrupted before completion","messagePattern":"Snapshot was interrupted before completion","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/scan/MySqlSnapshotSplitReadTask.java","lineNumber":119,"sourceCode":"\n    @Override\n    public SnapshotResult<MySqlOffsetContext> execute(\n            ChangeEventSource.ChangeEventSourceContext context,\n            MySqlPartition partition,\n            MySqlOffsetContext previousOffset)\n            throws InterruptedException {\n        SnapshottingTask snapshottingTask = getSnapshottingTask(partition, previousOffset);\n        final SnapshotContext<MySqlPartition, MySqlOffsetContext> ctx;\n        try {\n            ctx = prepare(partition);\n        } catch (Exception e) {\n            LOG.error(\"Failed to initialize snapshot context.\", e);\n            throw new RuntimeException(e);\n        }\n        try {\n            return doExecute(context, previousOffset, ctx, snapshottingTask);\n        } catch (InterruptedException e) {\n            LOG.warn(\"Snapshot was interrupted before completion\");\n            throw e;\n        } catch (Exception t) {\n            throw new DebeziumException(t);\n        }\n    }\n\n    @Override\n    protected SnapshotResult<MySqlOffsetContext> doExecute(\n            ChangeEventSource.ChangeEventSourceContext context,\n            MySqlOffsetContext previousOffset,\n            AbstractSnapshotChangeEventSource.SnapshotContext<MySqlPartition, MySqlOffsetContext>\n                    snapshotContext,\n            AbstractSnapshotChangeEventSource.SnapshottingTask snapshottingTask)\n            throws Exception {\n        final MySqlSnapshotContext ctx = (MySqlSnapshotContext) snapshotContext;\n        ctx.offset = offsetContext;\n\n        final BinlogOffset lowWatermark = currentBinlogOffset(jdbcConnection);","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/scan/MySqlSnapshotSplitReadTask.java#L101-L137","documentation":"MySqlSnapshotSplitReadTask.execute() runs the snapshot for a MySQL split. If the snapshot thread is interrupted during doExecute (job cancel, failover, checkpoint timeout), it logs this warning and rethrows InterruptedException rather than wrapping in DebeziumException. The snapshot did not complete.","triggerScenarios":"Interruption while the MySQL snapshot query/backfill loop is running — engine failover, task cancellation, or checkpoint timeout triggers an interrupt of the split reader thread.","commonSituations":"Very large table snapshot exceeding checkpoint timeout; worker restart during snapshot; user cancel; repeated failovers due to unstable cluster.","solutions":["If part of an intentional cancel/failover, resume the job from checkpoint — this log alone is informational.","Increase checkpoint timeout/interval so snapshot phases aren't interrupted (checkpoint.timeout config).","Reduce snapshot duration: increment source parallelism, chunk large tables, tune fetch size.","Investigate the original interrupting failure in worker logs and fix that root cause.","Ensure stable cluster resources (memory/CPU) to avoid task restarts mid-snapshot."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// estimate snapshot duration: row counts * fetch time per chunk\n// set checkpoint.timeout in job config accordingly","typeGuard":null,"tryCatchPattern":"try {\n    task.execute(ctx);\n} catch (InterruptedException e) {\n    Thread.currentThread().interrupt();\n    // retry the split or restore from checkpoint\n}","preventionTips":["Raise checkpoint timeout above worst-case snapshot time","Use chunked/parallel snapshotting for large tables","Avoid manual cancels during the snapshot phase","Fix any recurring worker restarts before rerunning snapshots"],"tags":["cdc","mysql","snapshot","interrupted"],"backgroundTag":"request-timeout","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}