{"record":{"id":"65228a094f068f54","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-required-binlog-sequence-65228a","errorCode":null,"errorMessage":"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","messagePattern":"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","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":635,"sourceCode":"            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,\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) {","sourceCodeStart":617,"sourceCodeEnd":653,"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#L617-L653","documentation":"Diagnostic WARN emitted when the required binlog sequence number is HIGHER than the newest file present on the server — the connector holds a position ahead of what this MySQL instance knows, typically meaning it is now talking to a different/out-of-date server rather than the original one.","triggerScenarios":"logBinlogRangeAnalysis (via logBinlogNotAvailableDiagnostics) finds required.number > max of available sequences — e.g. required mysql-bin.000200 while the server's latest is mysql-bin.000150.","commonSituations":"DNS/LB switching the client to a lagging replica or a rebuilt instance; failover to a server whose binlogs were RESET MASTER / re-initialized; restoring the database from an old snapshot while the job keeps its old offsets; containerized MySQL recreated from an older image/volume.","solutions":["Confirm the connector's endpoint resolves to the ORIGINAL primary (check @@server_uuid / @@hostname against the one in the saved offset).","If connecting via proxy/LB, pin CDC traffic to the primary node.","If the server was rebuilt with RESET MASTER, restart the CDC job from a fresh snapshot — old offsets are meaningless.","On a legit failover, re-point the job using GTID-based offsets or re-snapshot from the new primary."],"exampleFix":"// before: LB round-robins replicas\ncdc.url = jdbc:mysql://mysql-lb.internal:3306\n// after: pin to primary\ncdc.url = jdbc:mysql://mysql-primary.internal:3306","handlingStrategy":"validation","validationCode":"SELECT @@hostname, @@server_uuid; SHOW BINARY LOGS; -- must match the server that produced the job's saved offsets","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin CDC jobs to the primary endpoint, not load-balanced endpoints.","After failover, re-snapshot or re-base offsets on the new primary.","Guard against RESET MASTER on servers with active CDC consumers.","Compare server_uuid with the offset's recorded server id/uuid before resuming."],"tags":["mysql","cdc","binlog","replication","diagnostics"],"backgroundTag":"binlog-offset-mismatch","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"}