{"record":{"id":"6cb519c7ae5bec1b","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-required-binlog-sequence-6cb519","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: required binlog sequence {}{} is within available range {}{}..{}{} but missing; possible manual binlog deletion, binlog.index corruption, or connecting to a different MySQL instance intermittently","messagePattern":"MySQL-CDC diagnostic: required binlog sequence (.+?)(.+?) is within available range (.+?)(.+?)\\.\\.(.+?)(.+?) but missing; possible manual binlog deletion, binlog\\.index corruption, or connecting to a different MySQL instance intermittently","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/MySqlSourceFetchTaskContext.java","lineNumber":642,"sourceCode":"            return;\n        }\n\n        if (required.number < min) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: required binlog sequence {}{} is older than the earliest available {}{}; likely purged/expired binlog on server\",\n                    required.prefix,\n                    required.number,\n                    required.prefix,\n                    min);\n        } else if (required.number > max) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: required binlog sequence {}{} is newer than the latest available {}{}; possible connection to an out-of-date replica, proxy routing to different instance, or RESET MASTER\",\n                    required.prefix,\n                    required.number,\n                    required.prefix,\n                    max);\n        } else {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: required binlog sequence {}{} is within available range {}{}..{}{} but missing; possible manual binlog deletion, binlog.index corruption, or connecting to a different MySQL instance intermittently\",\n                    required.prefix,\n                    required.number,\n                    required.prefix,\n                    min,\n                    required.prefix,\n                    max);\n        }\n    }\n\n    private static String summarizeBinlogFiles(List<String> files) {\n        if (files == null || files.isEmpty()) {\n            return \"available binlog files: (empty)\";\n        }\n        int total = files.size();\n        int headCount = Math.min(BINLOG_FILE_SAMPLE_SIZE, total);\n        int tailCount = Math.min(BINLOG_FILE_SAMPLE_SIZE, Math.max(0, total - headCount));\n","sourceCodeStart":624,"sourceCodeEnd":660,"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/MySqlSourceFetchTaskContext.java#L624-L660","documentation":"Diagnostic WARN emitted when the required binlog sequence falls numerically BETWEEN the smallest and largest available binlog files, yet the exact required file is absent from SHOW BINARY LOGS. The server's file list is 'holey': the file was deleted selectively, the binlog index is inconsistent, or the queries hit different servers at different times.","triggerScenarios":"logBinlogRangeAnalysis (via logBinlogNotAvailableDiagnostics): min <= required.number <= max but the required filename is not in the enumerated list — e.g. available {000100..000150} minus 000120, required 000120.","commonSituations":"Manual PURGE BINARY LOGS TO a later file or manual rm of individual binlog files (corrupting binlog.index); a load balancer flapping between primary and replica with divergent binlog sets; RESET MASTER partially replayed across nodes.","solutions":["Check whether files were deleted manually (PURGE BINARY LOGS, rm) and repair/validate the binlog.index file.","Pin the CDC connection to a single MySQL instance (bypass proxies/LBs) so SHOW BINARY LOGS is answered consistently.","If the gap file is unrecoverable, restart the CDC job from a fresh snapshot.","Restore the missing binlog file from backups if resume-from-offset is required."],"exampleFix":"// before: deleting binlogs directly on disk\nrm /var/lib/mysql/mysql-bin.000120*\n// after: use supported purge of all files up to a point\nmysql> PURGE BINARY LOGS TO 'mysql-bin.000151';","handlingStrategy":"validation","validationCode":"SHOW BINARY LOGS; -- confirm no gaps: every file between min and max must be listed","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never rm binlog files directly; use PURGE BINARY LOGS.","If binlog.index is suspected corrupt, stop the server and repair before resuming CDC.","Route CDC traffic to one instance; inconsistent SHOW BINARY LOGS across nodes causes 'hole' symptoms.","Restore missing files from backup to resume from the exact offset."],"tags":["mysql","cdc","binlog","diagnostics"],"backgroundTag":"binlog-file-missing","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"}