0

I have 4 MySQL-Servers (Version: 8.0.40) set up in a multi-primary group replication configuation. Recently, I added MySQL Router (Version 8.0.4) in order to implement failover to the other servers in case the MySQL-Server on the localhost becomes unavailable. The failover part using the routing-strategy "first-available" works flawlessly. However, what doesn't work flawlessly is reverting back to the first MySQL-Server in the list after failover. It sticks with the second server in the list. When the second server becomes unavailable, it'll failover to the third server in the list. In other words: It mimicks the behaviour of the routing_strategy "next-available".

first-available: the new connection is routed to the first available server from the destinations list. In case of failure, the next available server is used. This cycle continues until all servers are unavailable.

next-available: like first-available, in that the new connection is routed to the first available server from the destinations list. Unlike first-available, if a server is marked as unreachable then it gets discarded and is never used again as a destination.

MySQL Router Doc

I have also tried the "next-available" option just to make sure that the doc doesn't have it backwards. But in my current setting those two options appear to behave exactly the same way.

The relevant section in my config file looks like this:

[routing:simple_redirect]

bind_address = 127.0.0.1:7001 destinations = 127.0.0.1:3306, server2.com:3306, server3.com:3306, server4.com:3306 routing_strategy = first-available connect_timeout = 5

Does anyone know what the culprit might be?

I tried uninstalling and re-installing the MySQL-Router, tried using the now deprecated mode setting and read the docs to no end. I also installed MySQL Router 9.1.0 directly from the .deb package to see if this was a bug that they fixed in the last major release. So far no changed behaviour. Is it possible that MySQL Router "sees" that the currently failed-over server is marked as a Primary in the replication scheme and decides to stick with it? From what I read in the Docs, such behaviour should only work for a properly configured Cluster. However, this is not a cluster, just a very simple group replication.

BalticLab
  • 1
  • 1

0 Answers0