{"record":{"id":"b91bdbecc2fd3f92","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-cannot-compare-binlog-sequen","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: cannot compare binlog sequence because available binlog filenames don't match required prefix '{}'","messagePattern":"MySQL-CDC diagnostic: cannot compare binlog sequence because available binlog filenames don't match required prefix '(.+?)'","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":621,"sourceCode":"        BinlogFileNumber required = parseBinlogFileNumber(requiredBinlogFilename);\n        if (required == null) {\n            return;\n        }\n\n        long min = Long.MAX_VALUE;\n        long max = Long.MIN_VALUE;\n        boolean any = false;\n        for (String file : availableBinlogFiles) {\n            BinlogFileNumber parsed = parseBinlogFileNumber(file);\n            if (parsed == null || !required.prefix.equals(parsed.prefix)) {\n                continue;\n            }\n            any = true;\n            min = Math.min(min, parsed.number);\n            max = Math.max(max, parsed.number);\n        }\n        if (!any) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: cannot compare binlog sequence because available binlog filenames don't match required prefix '{}'\",\n                    required.prefix);\n            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,","sourceCodeStart":603,"sourceCodeEnd":639,"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#L603-L639","documentation":"Part of the binlog-not-available diagnostics: the connector parsed available binlog filenames from SHOW BINARY LOGS, but none of them matched the prefix of the required binlog file (e.g. required 'mysql-bin.000123' while server files are named 'binlog.000001'). Without a shared prefix, sequence comparison is impossible, so the connector reports it cannot determine whether the required file is older/newer than what the server has.","triggerScenarios":"logBinlogRangeAnalysis is invoked from logBinlogNotAvailableDiagnostics after a required binlog file is missing; every available filename fails to parse against required.prefix (log-bin basename changed, or server is a different instance with different naming).","commonSituations":"log-bin basename renamed in my.cnf and server restarted; connecting to a replica/proxy with different binlog naming than the original master; RESET MASTER wiping and regenerating files with a new prefix; switching between MySQL and MariaDB (mysql-bin vs mariadb-bin).","solutions":["Verify the job is connecting to the same MySQL instance that produced the required offset (check host, port, and proxy/replica routing).","Check the server's log_bin_basename in my.cnf — if the prefix changed, the required offsets are no longer interpretable; restart the CDC job from snapshot or a valid position.","Compare output of SHOW BINARY LOGS against the required filename manually.","If a proxy/load balancer is in front of MySQL, pin the connection to a single node."],"exampleFix":"// before: my.cnf prefix changed\nlog-bin = new-bin\n// after: keep the original basename so old offsets remain valid\nlog-bin = mysql-bin","handlingStrategy":"validation","validationCode":"SHOW BINARY LOGS; -- verify filename prefixes match the offset's binlog file, e.g. mysql-bin.%d","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never change log-bin basename on a server with live CDC consumers.","Pin CDC connections to a single instance (avoid LB/replica flapping).","Record the server's log_bin_basename when creating jobs.","Watch for RESET MASTER events in ops procedures."],"tags":["mysql","cdc","binlog","diagnostics"],"backgroundTag":"invalid-identifier-format","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"}