I plan to use MySQL with Galera cluster replication (Percona XtraDB Cluster).
I’m new to this kind of replication technology and I need some clarification.
What exactly will happen when I try to do some SQL query on the node that is out of sync with rest of the cluster (ie. network failure, quorum decided that node is failed and removed it from primary component)?
How to detect this situation on the SQL client application side?
ie. what error I will get on SQL SELECT * FROM xxx; or UPDATE xxx SET yyy=zzz;?
When node is out of sync i suspect that all read/write operations should end with failure to prevent split-brain and other problems, but what errors I will get and how to check it?
What I need is to detect that I’m connected do wrong node, so I could reconnect to other one
For lack of a better code in this case the mysqld will return 1047 (ER_UNKNOWN_COM_ERROR). So when this code is returned you can check
wsrep_local_statestatus variable. If it is 0, then the node is partitioned from primary component.