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

Negative binlog position values for MariaDB

XMLWordPrintable

      Bug report

      What Debezium connector do you use and what version?

      3.0

      What is the connector configuration?

      {
              "connector.class": "io.debezium.connector.mariadb.MariaDbConnector",
              "tasks.max": "1",
              "database.hostname": "0.0.0.0",
              "database.port": "3306",
              "database.user": "debezium",
              "database.password": "dbz",
              "database.server.id": "184054",
              "topic.prefix": "dbserver1",
              "database.include.list": "inventory",
              "schema.history.internal.kafka.bootstrap.servers": "10.0.2.100:9092",
              "schema.history.internal.kafka.topic": "schemahistory.inventory",
              "database.ssl.mode": "disabled"
      }
      

      What is the captured database version and mode of deployment?

      MariaDB 11.4.5

      What behavior do you expect?

      Expect positive position values

      What behavior do you see?

      ...
              "source": {
                  "version": "3.0.7.Final",
                  "connector": "mariadb",
                  "name": "dbserver1",
                  "ts_ms": 1741097989000,
                  "snapshot": "false",
                  "db": "inventory",
                  "sequence": null,
                  "ts_us": 1741097989000000,
                  "ts_ns": 1741097989000000000,
                  "table": "customers",
                  "server_id": 1,
                  "gtid": "0-1-29",
                  "file": "mysqld-bin.000002",
                  "pos": -124,
                  "row": 0,
                  "thread": null,
                  "query": null
              }
      ...
      

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

      I assume, 3.0 is the latest stable version and, as far as I can see from https://debezium.io/releases/3.0/ , it should support MariaDB 11.4.X.

      But testing it for MariaDB 11.2.6 and 11.3.2 versions, I observed positive values, so it is probably something specific to 11.4 version.

      How to reproduce the issue using our tutorial deployment?

      podman pod create --name=dbz -p 8083:8083
      
      
      podman run -it --rm --name zookeeper --pod dbz quay.io/debezium/zookeeper:3.0
      
      
      podman run -it --rm --name kafka --pod dbz quay.io/debezium/kafka:3.0
      
      
      podman run -it --rm --name mariadb --pod dbz -e MARIADB_ROOT_PASSWORD=debezium -e MARIADB_USER=mariadbuser -e MARIADB_PASSWORD=mariadbpw docker.io/library/mariadb:11.4.5 --log-bin --binlog-format=ROW --binlog-row-image=FULL
      
      
      podman run -it --rm --name mariadbterm --pod dbz docker.io/library/mariadb:11.4.5 sh -c 'exec mariadb -h 0.0.0.0 -uroot -pdebezium'
      
      
      # Apply statements from https://github.com/debezium/container-images/blob/main/examples/mariadb/3.0/inventory.sql
      
      
      # Had to specify BOOTSTRAP_SERVERS explicitly, otherwise did not work. Value may differ.
      podman run -it --rm --name connect --pod dbz -e GROUP_ID=1 -e CONFIG_STORAGE_TOPIC=my_connect_configs -e OFFSET_STORAGE_TOPIC=my_connect_offsets -e STATUS_STORAGE_TOPIC=my_connect_statuses -e BOOTSTRAP_SERVERS=PLAINTEXT://10.0.2.100:9092 quay.io/debezium/connect:3.0
      
      
      curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d '{ "name": "inventory-connector", "config": { "connector.class": "io.debezium.connector.mariadb.MariaDbConnector", "tasks.max": "1", "database.hostname": "0.0.0.0", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "topic.prefix": "dbserver1", "database.include.list": "inventory", "schema.history.internal.kafka.bootstrap.servers": "10.0.2.100:9092", "schema.history.internal.kafka.topic": "schemahistory.inventory",  "database.ssl.mode": "disabled"} }'
      

      Then the following statement

      UPDATE inventory.customers SET first_name='Anne Marie' WHERE id=1004;
      

      generates message with negative pos value specified above.

      Sorry if I missed something or misunderstood.

      Best regards,
      Dmitry

              Unassigned Unassigned
              ndmitry Dmitry Neustroev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: