{"record":{"id":"c84dc3b936a2d9c0","repo":"apache/seatunnel","slug":"connector-used-gtids-previously-but-mysql-does-no","errorCode":null,"errorMessage":"Connector used GTIDs previously, but MySQL does not know of any GTIDs or they are not enabled","messagePattern":"Connector used GTIDs previously, but MySQL does not know of any GTIDs or they are not enabled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","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":370,"sourceCode":"                    summarizeBinlogFiles(logNames));\n            logBinlogNotAvailableDiagnostics(binlogFilename, logNames, offset);\n        } else {\n            LOG.info(\"MySQL has the binlog file '{}' required by the connector\", binlogFilename);\n        }\n        return found;\n    }\n\n    private boolean checkGtidSet(MySqlOffsetContext offset) {\n        String gtidStr = offset.gtidSet();\n\n        if (gtidStr.trim().isEmpty()) {\n            return true; // start at beginning ...\n        }\n\n        String availableGtidStr = connection.knownGtidSet();\n        if (availableGtidStr == null || availableGtidStr.trim().isEmpty()) {\n            // Last offsets had GTIDs but the server does not use them ...\n            LOG.warn(\n                    \"Connector used GTIDs previously, but MySQL does not know of any GTIDs or they are not enabled\");\n            logGtidNotAvailableDiagnostics(offset);\n            return false;\n        }\n\n        // Get the GTID set that is available in the server ...\n        GtidSet availableGtidSet = new GtidSet(availableGtidStr);\n\n        // GTIDs are enabled\n        LOG.info(\"Merging server GTID set {} with restored GTID set {}\", availableGtidSet, gtidStr);\n\n        // Based on the current server's GTID, the GTID in MySqlOffsetContext is adjusted to ensure\n        // the completeness of\n        // the GTID. This is done to address the issue of being unable to recover from a checkpoint\n        // in certain startup\n        // modes.\n        GtidSet gtidSet = GtidUtils.fixRestoredGtidSet(availableGtidSet, new GtidSet(gtidStr));\n        LOG.info(\"Merged GTID set is {}\", gtidSet);","sourceCodeStart":352,"sourceCodeEnd":388,"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#L352-L388","documentation":"checkGtidSet() (called from isBinlogAvailable) validates GTID-based offsets. If the saved offset contains GTIDs but connection.knownGtidSet() returns null/empty — meaning the connected MySQL server has no known GTIDs or GTID mode is disabled — replication from that GTID position is impossible, so the warning is logged, diagnostics are emitted, and the fetch task cannot start.","triggerScenarios":"The connector's last saved offset has GTID fields, but the target server returns an empty knownGtidSet(): gtid_mode is OFF on the (possibly different) server, or the server never executed any GTID transactions (e.g. a fresh replica).","commonSituations":"Job originally ran against a GTID-enabled MySQL and is being restored against a server with gtid_mode=OFF; failover to a replica without GTIDs; someone disabled GTIDs on the server between checkpoints.","solutions":["Enable GTID mode on the server: SET GLOBAL gtid_mode=ON_PERMISSIVE; SET GLOBAL enforce_gtid_consistency=ON; SET GLOBAL gtid_mode=ON;","Re-enable gtid_mode permanently in my.cnf (gtid_mode=ON, enforce_gtid_consistency=ON) and restart/resume the job.","If GTIDs cannot be enabled, restart the CDC job with a new snapshot instead of the GTID offset.","Verify you are restoring against the same server/cluster that produced the offset (execute SELECT @@gtid_mode, @@server_uuid)."],"exampleFix":"-- before (my.cnf)\n# gtid_mode = ON\n-- after\ngtid_mode = ON\nenforce_gtid_consistency = ON","handlingStrategy":"validation","validationCode":"-- Before restoring a GTID-based checkpoint:\nSELECT @@global.gtid_mode, @@global.enforce_gtid_consistency;\n-- Must be ON and the server must have executed GTID transactions.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable gtid_mode=ON and enforce_gtid_consistency=ON on all MySQL servers in the topology","Never disable GTIDs on a server that CDC checkpoints depend on","Verify @@gtid_mode before pointing a restored job at a new host","Keep the connector paired with the same replication topology it snapshotted from"],"tags":["mysql","gtid","binlog","configuration"],"backgroundTag":"feature-not-enabled","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"}