Details
-
Enhancement
-
Resolution: Done
-
Minor
-
0.3
-
None
Description
When the MySQL connector is processing the binlog and the server returns an error, the binlog client library will throw a ServerException such as the following:
ERROR Task mysql-source-0 threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:142) org.apache.kafka.connect.errors.ConnectException: com.github.shyiko.mysql.binlog.network.ServerException: could not find next log; the first event 'mysql-bin.000001' at 4747, the last event read from './mysql-bin.000001' at 4870, the last byte read from './mysql-bin.000001' at 4870.
ServerException actually has the MySQL state and error code, but the way the connector is (not) handling this means that just the message part of the exception is reported to Kafka Connect and the log. Instead, the connector should make sure the MySQL state and error code are included in the exception message so that they are recorded.