HAProxy community

[HAProxy 2.2.2] Percona ClusterCheck Problem

Hi, In the latest HAProxy version there is a problem to check Percona MySQL Cluster state using http-check and clustercheck script. This problem was already described a few years ago https://github.com/olafz/percona-clustercheck/issues/2.

I decided to add 0.1sec sleep after Connection: close response:

    # Percona XtraDB Cluster node local state is 'Synced' => return HTTP 200
    # Shell return-code is 0
    echo -en "HTTP/1.1 200 OK\r\n"
    echo -en "Content-Type: text/plain\r\n"
    echo -en "Connection: close\r\n"
    sleep 0.1
    echo -en "Content-Length: 40\r\n"
    echo -en "\r\n"
    echo -en "Percona XtraDB Cluster Node is synced.\r\n"
    sleep 0.1
    exit 0

The oder way I can use tcp-check:

tcp-check connect port 9200
tcp-check send HEAD\ /\ HTTP/1.1\r\n
tcp-check send \r\n
tcp-check expect rstring HTTP/1\..\ (2..|3..)

Maybe you’ve a better idea?