We have configured MaxScale to route traffic to a three-node Galera MariaDB cluster, and verified it works using either connection-based (readconnroute) or statement-based (readwritesplit) modes when all nodes are healthy. We want all writes to go to a single node and have no preference as to a read-write split - we're just trying to avoid the case where writes can be routed to multiple nodes.
However, we observe that when a node fails a new master is chosen and new connections (and hence writes) are routed to this new master. When the original node returns, it regains 'master' status and regardless of the routing mechanism (connection- or statement-based) new connections are now routed to this node. Thus we are able to write to two nodes simultaneously.
How can we configure MaxScale to prevent failback in this scenario? I.e. once a new master is chosen, it remains master until it fails, irrespective of whether the previous master returns.
Our config file is attached.
Thanks,
Rob Dimsdale & Jonathan Berkhahn
CF-Services
Pivotal Software
--
You received this message because you are subscribed to the Google Groups "MaxScale" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxscale+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<MaxScale.cnf>
--
You received this message because you are subscribed to a topic in the Google Groups "MaxScale" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxscale/oWc4G4tG1TU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxscale+u...@googlegroups.com.
Node 0 fails, master assigned to node 1.Node 1 also fails, master assigned to node 2.Node 1 returns to health, master assigned to node 1 (even though node 2 is still healthy)Node 0 returns to health, master assigned to node 0 (even though node 1 is still healthy)
Node 0 fails, master assigned to node 1.Node 1 also fails, master assigned to node 2.Node 1 returns to health, master remains assigned to node 2Node 0 returns to health, master remains assigned to node 2Node 2 fails, master assigned to node 0
Hello Massimiliano,It's great to hear this is being worked on. Could you please confirm that I correctly understand the expected behavior?Without stickiness, MaxScale always assigns master status to healthy node with the lowest index id, even though the current master may be healthy.Node 0 fails, master assigned to node 1.Node 1 also fails, master assigned to node 2.Node 1 returns to health, master assigned to node 1 (even though node 2 is still healthy)Node 0 returns to health, master assigned to node 0 (even though node 1 is still healthy)With stickiness, MaxScale should only reroute connections when the current master fails.Node 0 fails, master assigned to node 1.Node 1 also fails, master assigned to node 2.Node 1 returns to health, master remains assigned to node 2Node 0 returns to health, master remains assigned to node 2Node 2 fails, master assigned to node 0Is this the same as you've described?
Also, could you help me understand why a Galera operator would want non-sticky "fallback" behavior?
Unless connections are closed by MaxScale on fallback (I don't think MaxScale is doing this?), it exposes the potential for deadlocking.
Even if MaxScale severed connections on fallback, it seems like this only makes sense if node 0 is somehow more important that the other cluster nodes in the cluster. Maybe all nodes are not given the same memory/cpu, or maybe other nodes are distributed in networks with higher latency?
In these cases, failing over to another node results in a degraded service state. We have been thinking that all cluster nodes should be equivalent, such that every node can serve as master without service degradation until it fails, but I imagine other operators may have different use cases. I'd be interested to hear some examples.Thank you,