{"record":{"id":"1653fc1b6d232756","repo":"apache/seatunnel","slug":"need-to-add-support-for-executed-gtids-for-version","errorCode":null,"errorMessage":"Need to add support for executed GTIDs for versions prior to 5.6.5","messagePattern":"Need to add support for executed GTIDs for versions prior to 5\\.6\\.5","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlReadOnlyIncrementalSnapshotChangeEventSource.java","lineNumber":288,"sourceCode":"    protected void updateHighWatermark() {\n        getExecutedGtidSet(getContext()::setHighWatermark);\n    }\n\n    private void getExecutedGtidSet(Consumer<GtidSet> watermark) {\n        try {\n            jdbcConnection.query(\n                    showMasterStmt,\n                    rs -> {\n                        if (rs.next()) {\n                            if (rs.getMetaData().getColumnCount() > 4) {\n                                // This column exists only in MySQL 5.6.5 or later ...\n                                final String gtidSet =\n                                        rs.getString(\n                                                5); // GTID set, may be null, blank, or contain a\n                                // GTID set\n                                watermark.accept(new GtidSet(gtidSet));\n                            } else {\n                                throw new UnsupportedOperationException(\n                                        \"Need to add support for executed GTIDs for versions prior to 5.6.5\");\n                            }\n                        }\n                    });\n            jdbcConnection.commit();\n        } catch (SQLException e) {\n            throw new DebeziumException(e);\n        }\n    }\n\n    @Override\n    protected void emitWindowOpen() {\n        updateLowWatermark();\n    }\n\n    @Override\n    protected void emitWindowClose(MySqlPartition partition) throws InterruptedException {\n        updateHighWatermark();","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlReadOnlyIncrementalSnapshotChangeEventSource.java#L270-L306","documentation":"getExecutedGtidSet() reads the executed GTID set (column 5 of SHOW MASTER STATUS / SHOW MASTER STATUS-family statement) to set low/high watermarks for read-only incremental snapshots. If the result set has 4 or fewer columns, the connected server (or statement variant) predates MySQL 5.6.5 and cannot provide the GTID column, so an UnsupportedOperationException is deliberately thrown. GTID-based incremental snapshots simply cannot run on such servers.","triggerScenarios":"Running the CDC source with incremental.snapshot.enabled=true (read-only or GTID-based incremental snapshot path) against MySQL older than 5.6.5, MariaDB whose equivalent statement lacks the 5th column, or a proxy that truncates SHOW MASTER STATUS columns.","commonSituations":"Legacy on-prem MySQL 5.5 instances; MariaDB where GTID semantics differ; cloud-managed databases exposing a reduced SHOW MASTER STATUS; misrouting the connector to a proxy/secondary that reports fewer columns.","solutions":["Upgrade the MySQL server to 5.6.5 or later (ideally 5.7+/8.0) — GTID columns are required.","Disable the incremental snapshot feature that needs GTIDs (set incremental snapshot off in the CDC config) and rely on regular snapshot + binlog streaming.","Enable GTID mode on the server if supported (gtid_mode=ON, enforce_gtid_consistency=ON) and verify 'SHOW MASTER STATUS' returns 5 columns.","Connect directly to the MySQL server rather than through a proxy that may alter the statement's result shape."],"exampleFix":"-- before (connector config)\nincremental.snapshot.enabled = true\n-- after (unsupported old server)\nincremental.snapshot.enabled = false","handlingStrategy":"validation","validationCode":"// Verify server supports GTID before enabling incremental snapshot:\n// mysql -u stuser -p -h <host> -e \"SELECT VERSION(); SHOW VARIABLES LIKE 'gtid_mode';\"\n// Require VERSION() >= 5.6.5 and gtid_mode=ON for GTID-based incremental snapshots.","typeGuard":null,"tryCatchPattern":"try {\n    startCdcJob();\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"executed GTIDs for versions prior to 5.6.5\")) {\n        // switch config: disable GTID/incremental snapshot or upgrade MySQL\n    } else {\n        throw e;\n    }\n}","preventionTips":["Check SELECT VERSION() >= 5.6.5 before enabling GTID-dependent features.","Enable gtid_mode=ON and enforce_gtid_consistency=ON where the server supports it.","Avoid proxies that strip columns from SHOW MASTER STATUS.","Prefer MySQL 8.0 for new CDC deployments."],"tags":["mysql","cdc","gtid","unsupported","version-compatibility"],"backgroundTag":"unsupported-operation","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"}