{"record":{"id":"1dfaf7902ce30ed9","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-connected-to-mysql-hostname","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: connected to MySQL hostname={}, port={}, server_id={}, server_uuid={}, read_only={}, super_read_only={}, version={}, gtid_mode={}","messagePattern":"MySQL-CDC diagnostic: connected to MySQL hostname=(.+?), port=(.+?), server_id=(.+?), server_uuid=(.+?), read_only=(.+?), super_read_only=(.+?), version=(.+?), gtid_mode=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","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":465,"sourceCode":"        logMySqlBinlogRetentionVariables();\n        logMySqlMasterStatus();\n        logMySqlReplicationStatus();\n    }\n\n    private void logMySqlServerIdentity() {\n        final String sql =\n                \"SELECT @@hostname AS hostname, @@port AS port, @@server_id AS server_id, \"\n                        + \"@@server_uuid AS server_uuid, @@read_only AS read_only, \"\n                        + \"@@super_read_only AS super_read_only, @@version AS version, \"\n                        + \"@@gtid_mode AS gtid_mode\";\n        try {\n            connection.query(\n                    sql,\n                    rs -> {\n                        if (!rs.next()) {\n                            return;\n                        }\n                        LOG.warn(\n                                \"MySQL-CDC diagnostic: connected to MySQL hostname={}, port={}, server_id={}, server_uuid={}, read_only={}, super_read_only={}, version={}, gtid_mode={}\",\n                                rs.getString(\"hostname\"),\n                                rs.getString(\"port\"),\n                                rs.getString(\"server_id\"),\n                                rs.getString(\"server_uuid\"),\n                                rs.getString(\"read_only\"),\n                                rs.getString(\"super_read_only\"),\n                                rs.getString(\"version\"),\n                                rs.getString(\"gtid_mode\"));\n                    });\n        } catch (SQLException e) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: failed to query MySQL server identity: {}\",\n                    e.getMessage());\n        }\n    }\n\n    private void logMySqlBinlogRetentionVariables() {","sourceCodeStart":447,"sourceCodeEnd":483,"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#L447-L483","documentation":"Diagnostic WARN from logMySqlServerIdentity that runs a query (SELECT of hostname, port, server_id, server_uuid, read_only, super_read_only, version, gtid_mode, typically via information_schema / @@variables) and logs the connected server's identity. It is invoked when binlog or GTID availability checks fail, letting developers verify which server they are actually talking to and in what mode it runs.","triggerScenarios":"Called by logBinlogNotAvailableDiagnostics or logGtidNotAvailableDiagnostics whenever binlog or GTID availability validation fails for the restored offset; emitted once per diagnostic run when the identity query returns a row.","commonSituations":"Investigating why a restart fails: confirming gtid_mode is OFF, the server is read_only/super_read_only (a replica), or the version is too old for required binlog features.","solutions":["Read the logged server_uuid/host to confirm connection target; if unexpected, fix connection config","If gtid_mode is not ON but the job requires GTID, enable GTID on the server","If read_only/super_read_only indicates a replica, decide whether reading from a replica is intended and ensure it forwards binlogs/GTIDs"],"exampleFix":"// before\nSHOW VARIABLES LIKE 'gtid_mode';  -- OFF\n// after\nSET @@GLOBAL.enforce_gtid_consistency=ON;\nSET @@GLOBAL.gtid_mode=OFF_PERMISSIVE; -- step to ON_PERMISSIVE then ON (restart may be required)","handlingStrategy":"validation","validationCode":"SELECT @@server_id, @@server_uuid, @@read_only, @@super_read_only, @@version, @@gtid_mode;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-flight check gtid_mode/version/read_only before every job start","Ensure CDC user can read system variables","Document expected source identity (uuid) and alert on drift"],"tags":["mysql","cdc","diagnostics","server-identity"],"backgroundTag":"unexpected-api-response-shape","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"}