Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-219

MySQL connector stops consuming data from binlog after server restart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 0.6
    • 0.5
    • mysql-connector
    • None
    • Hide

      Simply restart the connector after the MySQL server is restarted. Or, use MySQL Multi-Slave Replication (MSR) and configure the connector use use one of the slaves.

      Show
      Simply restart the connector after the MySQL server is restarted. Or, use MySQL Multi-Slave Replication (MSR) and configure the connector use use one of the slaves.

    Description

      Whenever we are restarting the server, the connector will show it is connected but it is not consuming the data. It is working fine when we are restarting the connector.
      The logs looks like

      Unable to find source-code formatter for language: txt. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       INFO   MySQL|whole-msr|binlog  Stopped reading binlog after 17720065 events, last recorded offset: {ts_sec=1490988983, file=mysql-bin.000344, pos=5747093, row=29, server_id=204658455, event=4}   [io.debezium.connector.mysql.BinlogReader]
      2017-04-12 16:35:56,228 ERROR  ||  Task attendance-connector-0 threw an uncaught and unrecoverable exception   [org.apache.kafka.connect.runtime.WorkerTask]
      org.apache.kafka.connect.errors.ConnectException
              at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:164)
              at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:131)
              at io.debezium.connector.mysql.BinlogReader$ReaderThreadLifecycleListener.onCommunicationFailure(BinlogReader.java:702)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:768)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:472)
              at com.github.shyiko.mysql.binlog.BinaryLogClient$5.run(BinaryLogClient.java:657)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.EOFException
              at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.read(ByteArrayInputStream.java:190)
              at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.readInteger(ByteArrayInputStream.java:46)
              at com.github.shyiko.mysql.binlog.event.deserialization.EventHeaderV4Deserializer.deserialize(EventHeaderV4Deserializer.java:35)
              at com.github.shyiko.mysql.binlog.event.deserialization.EventHeaderV4Deserializer.deserialize(EventHeaderV4Deserializer.java:27)
              at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.nextEvent(EventDeserializer.java:175)
              at io.debezium.connector.mysql.BinlogReader$1.nextEvent(BinlogReader.java:116)
              at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:741)
              ... 3 more
      2017-04-12 16:35:56,230 ERROR  ||  Task is being killed and will not recover until manually restarted   [org.apache.kafka.connect.runtime.WorkerTask]
      Apr 12, 2017 4:36:02 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      INFO: Trying to restore lost connection to localhost:3306
      Apr 12, 2017 4:36:02 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      WARNING: Failed to restore connection to localhost:3306. Next attempt in 60000ms
      Apr 12, 2017 4:36:14 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      INFO: Trying to restore lost connection to localhost:3306
      Apr 12, 2017 4:36:14 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      WARNING: Failed to restore connection to localhost:3306. Next attempt in 60000ms
      Apr 12, 2017 4:37:02 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      INFO: Trying to restore lost connection to localhost:3306
      Apr 12, 2017 4:37:02 PM com.github.shyiko.mysql.binlog.BinaryLogClient connect
      INFO: Connected to localhost:3306 at mysql-bin.000366/33618385 (sid:5020, cid:67)
      2017-04-12 16:37:02,064 INFO   MySQL|attendance|binlog  Connected to MySQL binlog at localhost:3306, starting at binlog file 'mysql-bin.000366', pos=33618071, skipping 4 events plus 0 rows   [io.debezium.connector.mysql.BinlogReader]
      Apr 12, 2017 4:37:14 PM com.github.shyiko.mysql.binlog.BinaryLogClient$3 run
      INFO: Trying to restore lost connection to localhost:3306
      Apr 12, 2017 4:37:14 PM com.github.shyiko.mysql.binlog.BinaryLogClient connect
      INFO: Connected to localhost:3306 at mysql-bin.000366/33618385 (sid:5810, cid:86)
      2017-04-12 16:37:14,597 INFO   MySQL|whole-msr|binlog  Connected to MySQL binlog at localhost:3306, starting at binlog file 'mysql-bin.000366', pos=4, skipping 11158039 events plus 0 rows   [io.debezium.connector.mysql.BinlogReader]
      
      

      Attachments

        Issue Links

          Activity

            People

              jpechane Jiri Pechanec
              sanzzzay Sanjay Singh (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: