0

I am using Kafka and Debezium to connect to a MariaDB

I have a problem where in the event the MariaDB loses power and shutsdown abruptly, on restart Debezium is no longer able to connect

I have this error in particular

[2023-12-06 13:26:05,800] ERROR [192.168.108.1|task-0] Error during binlog processing. Last offset stored = null, binlog reader near position = mariadb-bin.000006/53938 (io.debezium.connector.mysql.MySqlStreamingChangeEventSource:1161)

io.debezium.DebeziumException: Client requested master to start replication from impossible position; the first event 'mariadb-bin.000006' at 53938, the last event read from 'mariadb-bin.000006' at 4, the last byte read from 'mariadb-bin.000006' at 4. Error code: 1236; SQLSTATE: HY000.

And on the mariadb side i have this

+--------------------+-----------+
| Log_name           | File_size |
+--------------------+-----------+
| mariadb-bin.000001 |       330 |
| mariadb-bin.000002 |       330 |
| mariadb-bin.000003 |     67494 |
| mariadb-bin.000004 |     69007 |
| mariadb-bin.000005 |    126922 |
| mariadb-bin.000006 |     45056 |
| mariadb-bin.000007 |    103304 |
+--------------------+-----------+
7 rows in set (0.001 sec)

MariaDB [(none)]> show master status;
+--------------------+----------+--------------+------------------+
| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+--------------+------------------+
| mariadb-bin.000007 |   103304 |              |                  |
+--------------------+----------+--------------+------------------+
1 row in set (0.000 sec)

I have tried resetting offsets on Kafka side of things but I get the exact same error without fail, does anyone know why exactly there is a problem and how to resolve things? All help appreciated thanks so much!

1 Answer 1

0

Change configuration to include sync_binlog = 1 on the Primary and restart the server.

and move the pointer (on the Replica) to the beginning (Pos=0 or 4) of the next binlog (on the Primary).

https://stackoverflow.com/a/46366177/1766831

2
  • Hey thanks for help, I added this to config file on the mariadb side but I still get the same error :( You have any idea how to change the bin log stuff in Kafka by any chance? I spent entire day trying to change it but very consistently it's trying to read from the same binlog file and position
    – RedRum69
    Commented Dec 6, 2023 at 21:06
  • I added a few more details.
    – Rick James
    Commented Dec 7, 2023 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.