]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: checks: Implement MySQL check using tcp-check rules
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 2 Apr 2020 16:07:37 +0000 (18:07 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:38 +0000 (09:39 +0200)
commitf2b3be5c27dac436183980e60cc508e9241635ee
tree3b8754568e86036c353f49ad193abeb943744faf
parentce355074f1fc76102753cc588d17e2530b4f31a0
MEDIUM: checks: Implement MySQL check using tcp-check rules

A share tcp-check ruleset is now created to support MySQL checks. This way no
extra memory is used if several backends use a MySQL check.

One for the following sequence is used :

    ## If no extra params are set
    tcp-check connect default linger
    tcp-check expect custom  ## will test the initial handshake

    ## If the username is defined
    tcp-check connect default linger
    tcp-check send-binary MYSQL_REQ log-format
    tcp-check expect custom  ## will test the initial handshake
    tcp-check expect custom  ## will test the reply to the client message

The log-format hexa string MYSQL_REQ depends on 2 preset variables, the packet
header containing the packet length and the sequence ID (check.header) and the
username (check.username). If is also different if the "post-41" option is set
or not. Expect rules relies on custom functions to check MySQL server packets.
include/proto/checks.h
include/types/checks.h
include/types/proxy.h
src/cfgparse-listen.c
src/checks.c