Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When a node is in the DONOR/DESYNCED state, it doesn't participate in flow control, so its data can get stale. Galera states are explained here:
http://galeracluster.com/documentation-webpages/nodestates.html#changes-in-the-node-state
A node's state can be checked with wsrep_local_state:
http://galeracluster.com/documentation-webpages/galerastatusvariables.html#wsrep-local-state
MaxScale's Galera Monitor treats nodes in the DONOR/DESYNCED state as unavailable unless available_when_donor is configured. This ensures that MaxScale does not route queries to a node that has stale data.
As far as I can tell, MariaDB Connector/J's load balancing implementation does not have a way to keep queries from being sent to desynced Galera nodes. Maybe we should add an option that would enable that kind of behavior?
There is no monitor inside connector, but still, there is a specific implementation for galera.
Pools validate connection state before borrowing it. This is done using Connection.isValid(timeout).
Standard implementation of Connection.isValid() will emit a COM_PING. For galera, connection will emit a query in place of COM_PING : "show status like 'wsrep_cluster_status' ", and check that status is "PRIMARY". To ensure not only that socket is set, but that server is in PRIMARY state. So, using 'wsrep_cluster_status' not 'wsrep_local_state', but result will be the same.
see
CONJ-400