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

JDBC Sink Connector tasks fail on deadlocks when sinking into a SQL Server database

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • under-triaging
    • 2.5.0.Final
    • jdbc-connector
    • None
    • False
    • None
    • False
    • Important

    Description

      Bug report

      This issue is created after vjuranek@redhat.com suggestion from this discussion

      What Debezium connector do you use and what version?

      JdbcSinkConnector (version 2.5.0.Final)

      What is the connector configuration?

      I am using a Bitnami Kafka Docker container to create the following connector :

       

      {
        "name": "db-sink-connector",
        "config": {
          "name": "db-sink-connector",
          "connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
          "tasks.max": "50",
          "connection.url": "jdbc:sqlserver://[REDACTED]",
          "connection.username": "sa",
          "connection.password": "[REDACTED]",
          "insert.mode": "upsert",
          "delete.enabled": "true",
          "truncate.enabled": "true",
          "primary.key.mode": "record_key",
          "schema.evolution": "basic",
          "quote.identifiers": "true",
          "batch.size": 10000,
          "topics.regex": "[REDACTED]",
          "transforms": "dropPrefix",
          "transforms.dropPrefix.type": "org.apache.kafka.connect.transforms.RegexRouter",
          "transforms.dropPrefix.regex": "[REDACTED]",
          "transforms.dropPrefix.replacement": "$1",
          "value.converter": "io.confluent.connect.avro.AvroConverter",
          "value.converter.schemas.enable": true,
          "value.converter.schema.registry.url": "http://kafka-schema-registry:8081",
          "key.converter": "io.confluent.connect.avro.AvroConverter",
          "key.converter.schemas.enable": true,
          "key.converter.schema.registry.url": "http://kafka-schema-registry:8081"
        }
      } 

       

      What is the captured database version and mode of depoyment?

      The target sink database is a SQL Server 2019 instance, hosted on a Windows 10 Pro computer, available on the same local network as the connector host computer.

      What behaviour do you expect?

      The connector sinks all configured topics into the target database.

      What behaviour do you see?

      Some of the configured tasks encounter deadlocks and are not recovering afterwards. The deadlocks may happen immediately after starting the connector or after a much longer time, depending on the topics data.

      • When using tasks.max=2 tasks and a single configured topic to sink. The deadlock happens for one of the tasks soon after starting the connector.
      • When using tasks.max=100 and about 130 topics of various message sizes (from 10 to 6M messages), some of the tasks encounter deadlocks after about 1 hour ; after most small topics are completely sinked into the target database.

      Do you have the connector logs, ideally from start till finish?

      Here are logs when a deadlock happen for one of the tasks : https://pastebin.com/raw/gTLgi7HS

      Attachments

        Activity

          People

            vjuranek@redhat.com Vojtech Juranek
            jcourelscj Jordan COUREL
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: