{"record":{"id":"4eee42a99f7446fb","repo":"apache/seatunnel","slug":"read-split-s-error-due-to-s-4eee42","errorCode":null,"errorMessage":"Read split %s error due to %s.","messagePattern":"Read split (.+?) error due to (.+?)\\.","errorType":"exception","errorClass":"org.apache.seatunnel.api.table.type.SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/external/IncrementalSourceStreamFetcher.java","lineNumber":224,"sourceCode":"     * <p>Before event batch: [a, b, c, SchemaChangeEvent-1, SchemaChangeEvent-2, d, e]\n     *\n     * <p>After event batch: [a, b, c, checkpoint-before] [SchemaChangeEvent-1, SchemaChangeEvent-2,\n     * checkpoint-after] [d, e]\n     *\n     * <p>For example 2:\n     *\n     * <p>Before event batch: [SchemaChangeEvent-1, SchemaChangeEvent-2, a, b, c, d, e]\n     *\n     * <p>After event batch: [checkpoint-before] [SchemaChangeEvent-1, SchemaChangeEvent-2,\n     * checkpoint-after] [a, b, c, d, e]\n     */\n    Iterator<SourceRecords> splitSchemaChangeStream(List<DataChangeEvent> batchEvents) {\n        return new SchemaChangeStreamSplitter().split(batchEvents);\n    }\n\n    private void checkReadException() {\n        if (readException != null) {\n            throw new SeaTunnelException(\n                    String.format(\n                            \"Read split %s error due to %s.\",\n                            currentIncrementalSplit, readException.getMessage()),\n                    readException);\n        }\n    }\n\n    @Override\n    public void close() {\n        try {\n            // 1. try close the split task\n            if (streamFetchTask != null) {\n                try {\n                    streamFetchTask.shutdown();\n                } catch (Exception e) {\n                    log.error(\"Close stream split read task error\", e);\n                }\n            }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/reader/external/IncrementalSourceStreamFetcher.java#L206-L242","documentation":"IncrementalSourceStreamFetcher (incremental/binlog phase) captures exceptions from its streaming task into readException; checkReadException(), called from pollSplitRecords, rethrows it as SeaTunnelException with the incremental split id. It is the streaming-phase analogue of the scan fetcher's read-exception rethrow, surfacing asynchronous stream failures at the record-polling site.","triggerScenarios":"The incremental (binlog/WAL) streaming task throws (replication stream disconnected, server closed binlog, deserialization error, replication slot dropped); the next pollSplitRecords call rethrows the stored exception.","commonSituations":"MySQL purged binlog files the stream still needs; PostgreSQL replication slot was dropped or wal_level insufficient; replication user privileges changed; long incremental phase exceeded server timeouts.","solutions":["Read e.getCause() on the SeaTunnelException for the true replication error (e.g. 'binlog purged', 'replication slot does not exist').","For binlog purged: increase binlog retention (expire_logs_days / binlog_expire_logs_seconds) and restart the job from snapshot.","For PostgreSQL: recreate the replication slot and ensure wal_level=logical and adequate max_slot_wal_keep_size.","Verify replication credentials and privileges, then restart from the last checkpoint."],"exampleFix":"// diagnose root cause\ntry {\n    records = streamFetcher.pollSplitRecords();\n} catch (SeaTunnelException e) {\n    log.error(\"Incremental split {} failed: {}\", e.getCause());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"-- preflight checks\n-- MySQL: SHOW VARIABLES LIKE 'log_bin'; ensure binlog retained\n-- PostgreSQL: SELECT slot_name FROM pg_replication_slots;","typeGuard":null,"tryCatchPattern":"try {\n    records = streamFetcher.pollSplitRecords();\n} catch (SeaTunnelException e) {\n    log.error(\"Incremental read failed, root cause: {}\", e.getCause());\n    throw e;\n}","preventionTips":["Set binlog/retention high enough to outlive the snapshot phase.","Protect PostgreSQL replication slots from being dropped; monitor slot lag.","Use a dedicated replication user with stable privileges."],"tags":["cdc","incremental-stream","binlog","replication"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}