Here’s my Github pull request for improved error handling in Percona’s clustercheck utility, used by haproxy for health-checking a Percona XtraDB Cluster.
It adds two features:
- 401 Unauthorized response for failed authentication
- 404 Not Found response if the mysql program can’t be found
The error detection is done in a low-latency manner using PIPESTATUS, without an additional database connection. Here is colored diff output.