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

MySQL read-only connector with Kafka signals enabled fails on start up

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.0.Final
    • 2.3.0.CR1
    • mysql-connector
    • None
    • False
    • None
    • False

      What Debezium connector do you use and what version?

      MySQL connector version 2.3.0.CR1

      What is the connector configuration?

      "read.only": "true",
      "signal.enabled.channels": "kafka"

      What behaviour do you expect?

      Connector starts up and consumes Kafka signals topic from the last committed offset

      What behaviour do you see?

      Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted   [org.apache.kafka.connect.runtime.WorkerTask] thread=task-thread-test_connector-0
      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
       at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:72)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:125)
       at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       at java.base/java.lang.Thread.run(Thread.java:833)
      
      
      Caused by: java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
       at org.apache.kafka.clients.consumer.KafkaConsumer.acquire(KafkaConsumer.java:2491)
       at org.apache.kafka.clients.consumer.KafkaConsumer.acquireAndEnsureOpen(KafkaConsumer.java:2475)
       at org.apache.kafka.clients.consumer.KafkaConsumer.seek(KafkaConsumer.java:1593)
       at io.debezium.pipeline.signal.channels.KafkaSignalChannel.reset(KafkaSignalChannel.java:154)
       at io.debezium.connector.mysql.MySqlReadOnlyIncrementalSnapshotChangeEventSource.restoreOffset(MySqlReadOnlyIncrementalSnapshotChangeEventSource.java:111)
       at io.debezium.connector.mysql.MySqlReadOnlyIncrementalSnapshotChangeEventSource.init(MySqlReadOnlyIncrementalSnapshotChangeEventSource.java:102)
       at io.debezium.connector.mysql.MySqlReadOnlyIncrementalSnapshotChangeEventSource.init(MySqlReadOnlyIncrementalSnapshotChangeEventSource.java:80)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$initStreamEvents$3(ChangeEventSourceCoordinator.java:221)
       at java.base/java.util.Optional.ifPresent(Optional.java:178)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.initStreamEvents(ChangeEventSourceCoordinator.java:221)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:203)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:172)
       at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:118)
       ... 5 more 

      Do you see the same behaviour using the latest relesead Debezium version?

      Related to DBZ-6511 Restore Kafka signal offset only when KafkaSignalChannel is enabled

      Implementation ideas (optional)

      event-source-coordinator and connector task are two separate threads. Call Kafka signal reset from the task thread

              Unassigned Unassigned
              kgalieva Kate Galieva (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: