{"record":{"id":"dc5af69752682e74","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-variable","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: variable {}={}","messagePattern":"MySQL-CDC diagnostic: variable (.+?)=(.+?)","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":500,"sourceCode":"\n    private void logMySqlBinlogRetentionVariables() {\n        logMySqlVariable(\"log_bin\");\n        logMySqlVariable(\"binlog_format\");\n        logMySqlVariable(\"binlog_expire_logs_seconds\");\n        logMySqlVariable(\"expire_logs_days\");\n    }\n\n    private void logMySqlVariable(String variableName) {\n        final String sql = String.format(\"SHOW VARIABLES LIKE '%s'\", variableName);\n        try {\n            connection.query(\n                    sql,\n                    rs -> {\n                        if (!rs.next()) {\n                            LOG.warn(\"MySQL-CDC diagnostic: variable {} not found\", variableName);\n                            return;\n                        }\n                        LOG.warn(\n                                \"MySQL-CDC diagnostic: variable {}={}\",\n                                rs.getString(1),\n                                rs.getString(2));\n                    });\n        } catch (SQLException e) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: failed to query variable {}: {}\",\n                    variableName,\n                    e.getMessage());\n        }\n    }\n\n    private void logMySqlMasterStatus() {\n        try {\n            connection.query(\n                    \"SHOW MASTER STATUS\",\n                    rs -> {\n                        if (!rs.next()) {","sourceCodeStart":482,"sourceCodeEnd":518,"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#L482-L518","documentation":"Diagnostic WARN from logMySqlVariable logging the successful lookup of a MySQL system variable: variable name and value (e.g. binlog_expire_logs_seconds=259200). It is part of the binlog-retention diagnostics printed when binlog/GTID availability checks fail, showing how long binlogs are retained on the server.","triggerScenarios":"Called from logMySqlBinlogRetentionVariables via logMySqlVariable whenever SHOW VARIABLES LIKE '<retention variable>' returns a row during a binlog/GTID diagnostic run.","commonSituations":"Interpreting restart failures: a very small retention value explains why required binlog files were purged.","solutions":["Compare the logged value with the binlog file/position of the restored offset; increase retention (SET PERSIST binlog_expire_logs_seconds=...) if binlogs are purged too fast","Use the value with logBinlogRangeAnalysis output to confirm the required binlog still exists","No code change needed — this is informational"],"exampleFix":"// before\nSET PERSIST binlog_expire_logs_seconds = 86400;\n// after\nSET PERSIST binlog_expire_logs_seconds = 604800;","handlingStrategy":"validation","validationCode":"SHOW VARIABLES LIKE 'binlog_expire_logs_seconds';\nSHOW VARIABLES LIKE 'expire_logs_days';\n-- compare retention with checkpoint binlog file age","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep binlog retention comfortably longer than the maximum expected job downtime","Monitor retention values in configuration management","Alert when checkpoint age approaches binlog retention"],"tags":["mysql","cdc","diagnostics","binlog","retention"],"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-14T05:17:10.506Z"}