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

Fix null event timestamp possible from FORMAT_DESCRIPTION and PREVIOUS_GTIDS events in MySqlStreamingChangeEventSource::setEventTimestamp

XMLWordPrintable

    • False
    • None
    • False
    • Low

      Regression from https://github.com/debezium/debezium/pull/5281 where the FORMAT_DESCRIPTION and PREVIOUS_GTIDS events resulting in a null pointer exception.

      These specific events does not have explicit handlers in the MySQL Connector and I stumbled on them via these choke logs:

      Feb 26, 2024 11:22:00 PM com.github.shyiko.mysql.binlog.BinaryLogClient notifyEventListeners
      WARNING: io.debezium.connector.mysql.MySqlStreamingChangeEventSource$$Lambda$1860/0x00000008016a7b80@78ecf20b choked on Event{header=EventHeaderV4

      Unknown macro: {timestamp=1708989435000, eventType=FORMAT_DESCRIPTION, serverId=6656, headerLength=19, dataLength=103, nextPosition=126, flags=0}

      , data=FormatDescriptionEventData{binlogVersion=4, serverVersion='8.0.34-26', headerLength=19, dataLength=98, checksumType=CRC32}}
      java.lang.NullPointerException: Cannot invoke "java.time.Instant.toEpochMilli()" because "this.eventTimestamp" is null
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.onEvent(MySqlStreamingChangeEventSource.java:224)
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$32(MySqlStreamingChangeEventSource.java:893)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1263)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1089)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:648)
      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:949)
      at java.base/java.lang.Thread.run(Thread.java:833)

      WARNING: io.debezium.connector.mysql.MySqlStreamingChangeEventSource$$Lambda$1860/0x00000008016a7b80@2fe28984 choked on Event{header=EventHeaderV4

      Unknown macro: {timestamp=1708989637000, eventType=PREVIOUS_GTIDS, serverId=64249, headerLength=19, dataLength=772, nextPosition=917, flags=128}

      , data=PreviousGtidSetEventData {gtidSet='1159f990-01de-11eb-83a6-42010ae7017d:1-107203748,19992277-440d-11ec-82bf-4201f30040f4:1-314981770,225b68d0-7cbc-11ee-9129-4201f3004270:1-979720445,2815fca4-01de-11eb-93a7-42010aef01a4:1-204102399,335523e0-7e05-11eb-b361-42010ae7ff2b:1-3439694596,38c6bf68-b9bc-11ec-8e37-4201f300409d:1-3039332855,413e5ac9-0aa6-11ec-9e30-4201f30080a0:1-266002682,6dadcd5d-23b4-11eb-b820-42010ae702b0:1-1803423602,75d63b9e-9241-11ed-bc34-4201f300413c:1-2757216064,767604d9-9626-11ee-b8b6-4201f3004390:1-1670728428,7ff3abb5-5ed1-11ed-a184-4201f3008218:1-49591093,91131c4a-b9bd-11ec-a9ef-4201f30080f7:1-723095240,97e34857-0aa5-11ec-9c98-4201f300808f:1-38520866,b5cb5c8d-0aa6-11ec-9293-4201f300409c:1-1556671893,bd9bbcdd-440c-11ec-8061-4201f3008256:1-144310183,cbbab159-82b8-11ec-ac89-4201f300431e:1-805223419,e5806f77-9243-11ed-897d-4201f3008146:1-2491036638,e6503b55-5ed3-11ed-b83d-4201f30042b7:1-1467585675,ed07f9fb-5790-11ec-af2e-4201f30041ec:1-1319667664'}}
      java.lang.NullPointerException: Cannot invoke "java.time.Instant.toEpochMilli()" because "this.eventTimestamp" is null
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.onEvent(MySqlStreamingChangeEventSource.java:224)
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$32(MySqlStreamingChangeEventSource.java:893)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1263)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1089)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:648)

      Pull request: https://github.com/debezium/debezium/pull/5322

            Unassigned Unassigned
            methodmissing Lourens Naudé
            Lourens Naudé
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: