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

Skip MySQL BinLog Event in case of Invalid Cell Values

    XMLWordPrintable

Details

    Description

      While deserializing MySQL BinLog events, if the deserializer faces invalid cell value, the mysql-connector throws Exception in Logs and halts processing.

      Such cases should be covered in event.deserialization.failure.handling.mode, so that Debezium can be setup to either "ignore" such events or just log a "warning" and skip past the event.

      Stacktrace of exception encountered with Invalid datetime value in MySQL DB

      org.apache.kafka.connect.errors.ConnectException: Invalid value for MonthOfYear (valid values 1 - 12): -76
             at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:200)
             at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:167)
             at io.debezium.connector.mysql.BinlogReader$ReaderThreadLifecycleListener.onEventDeserializationFailure(BinlogReader.java:964)
             at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:904)
             at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:559)
             at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:793)
             at java.lang.Thread.run(Thread.java:748)
      Caused by: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): -76
             at java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
             at java.time.temporal.ChronoField.checkValidValue(ChronoField.java:703)
             at java.time.LocalDate.of(LocalDate.java:267)
             at java.time.LocalDateTime.of(LocalDateTime.java:361)
             at io.debezium.connector.mysql.RowDeserializers.deserializeDatetime(RowDeserializers.java:378)
             at io.debezium.connector.mysql.RowDeserializers$WriteRowsDeserializer.deserializeDatetime(RowDeserializers.java:202)
             at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeCell(AbstractRowsEventDataDeserializer.java:176)
             at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeRow(AbstractRowsEventDataDeserializer.java:138)
             at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserializeRows(WriteRowsEventDataDeserializer.java:64)
             at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserialize(WriteRowsEventDataDeserializer.java:56)
             at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserialize(WriteRowsEventDataDeserializer.java:32)
      

      Attachments

        Activity

          People

            jpechane Jiri Pechanec
            akshay-bhardwaj7 Akshay Bhardwaj (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: