Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-5910

Error 1047 when trying to run semi-sync replication through Maxscale

    XMLWordPrintable

Details

    • MXS-SPRINT-242

    Description

      Setup

      • 1 server (master) behind 1 Maxscale
      • another server (replica) that is replicating from the first server by connecting to Maxscale
      • the servers have semi-sync replication enabled

      Expected

      • the replication should work normally

      Actual

      • The replica reconnects after every transactions due to

        [ERROR] Error reading packet from server: Unknown command (server_errno=1047)

      I'm attaching a simple docker-compose setup that demonstrates the issue
      to use unzip and run

      docker-compose -f docker-compose-mariadb-maxscale.yml up -d

      then after everything is up, wait another 30 seconds or so for the replication to start correctly and run something like

      docker exec -it mariadb-master mariadb -uroot -prootpassword --skip_ssl -e "create database asd; create table asd.asd (id int); insert into asd.asd (id) values (1); insert into asd.asd (id) values (1);"

      (example available in the insert.sh file)

      in the log of the replica you will see

      2025-08-14 10:42:33 5 [ERROR] Slave I/O: error connecting to master 'repl@maxscale-proxy:4006' - retry-time: 5  maximum-retries: 100000  message: Access denied for user 'repl'@'::ffff:172.18.0.4' (using password: YES), Internal MariaDB error code: 1045
      2025-08-14 10:43:03 5 [Note] Slave I/O thread: connected to master 'repl@maxscale-proxy:4006',replication starts at GTID position '100-1-16'
      2025-08-14 10:43:29 5 [ERROR] Error reading packet from server: Unknown command (server_errno=1047)
      2025-08-14 10:43:29 5 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mariadb-bin.000002' at position 471; GTID position '100-1-17'
      2025-08-14 10:43:29 5 [Note] Slave I/O thread: Start semi-sync replication to master 'repl@maxscale-proxy:4006' in log 'mariadb-bin.000002' at position 471
      2025-08-14 10:43:39 5 [ERROR] Error reading packet from server: Unknown command (server_errno=1047)
      2025-08-14 10:43:39 5 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mariadb-bin.000002' at position 614; GTID position '100-1-18'
      2025-08-14 10:43:39 5 [Note] Slave I/O thread: Start semi-sync replication to master 'repl@maxscale-proxy:4006' in log 'mariadb-bin.000002' at position 614
      2025-08-14 10:43:39 5 [ERROR] Error reading packet from server: Unknown command (server_errno=1047)
      2025-08-14 10:43:39 5 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mariadb-bin.000002' at position 956; GTID position '100-1-20'
      2025-08-14 10:43:39 5 [Note] Slave I/O thread: Start semi-sync replication to master 'repl@maxscale-proxy:4006' in log 'mariadb-bin.000002' at position 956

      on the master

      2025-08-14 10:52:59 10 [Note] Stop semi-sync binlog_dump to slave (server_id: 2)
      2025-08-14 10:52:59 14 [Note] Start binlog_dump to slave_server(2), pos(mariadb-bin.000002, 471), using_gtid(1), gtid('100-1-17')
      2025-08-14 10:52:59 14 [Note] Start semi-sync binlog_dump to slave (server_id: 2), pos(/var/lib/mysql/mariadb-bin.000002, 299)
      2025-08-14 10:53:09 13 [Warning] Timeout waiting for reply of binlog (file: mariadb-bin.000002, pos: 471), semi-sync up to file mariadb-bin.000002, position 299.
      2025-08-14 10:53:09 13 [Note] Semi-sync replication switched OFF.
      2025-08-14 10:53:09 14 [ERROR] Semi-sync master failed on net_flush() before waiting for slave reply
      2025-08-14 10:53:09 14 [Note] Stop semi-sync binlog_dump to slave (server_id: 2)
      2025-08-14 10:53:09 14 [Warning] Aborted connection 14 to db: 'unconnected' user: 'repl' host: '172.18.0.3' (Failed to run hook 'after_send_event')
      2025-08-14 10:53:09 16 [Note] Start binlog_dump to slave_server(2), pos(mariadb-bin.000002, 614), using_gtid(1), gtid('100-1-18')
      2025-08-14 10:53:09 16 [Note] Start semi-sync binlog_dump to slave (server_id: 2), pos(/var/lib/mysql/mariadb-bin.000002, 299)
      2025-08-14 10:53:09 16 [Note] Stop semi-sync binlog_dump to slave (server_id: 2)
      2025-08-14 10:53:09 17 [Note] Start binlog_dump to slave_server(2), pos(mariadb-bin.000002, 956), using_gtid(1), gtid('100-1-20')
      2025-08-14 10:53:09 17 [Note] Start semi-sync binlog_dump to slave (server_id: 2), pos(/var/lib/mysql/mariadb-bin.000002, 299)

      I've tested with multiple server and Maxscale versions and they all seem to act the same

      Attachments

        Issue Links

          Activity

            People

              markus makela markus makela
              petkovasilev Petko Vasilev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.