]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pattern: assign pattern IDs after checking the config validity
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2019 12:47:08 +0000 (14:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2019 12:52:25 +0000 (14:52 +0200)
commit0f93672dfea805268d674c97573711fbff7e0e70
treeda493ad1acdc0cc261cf85187b7fb15561bdef5e
parent46453d3f7d09c56b07a1b3745f1a2d24c5650c15
BUG/MEDIUM: pattern: assign pattern IDs after checking the config validity

Pavlos Parissis reported an interesting case where some map identifiers
were not assigned (appearing as -1 in show map). It turns out that it
only happens for log-format expressions parsed in check_config_validity()
that involve maps (log-format, use_backend, unique-id-header), as in the
sample configuration below :

    frontend foo
        bind :8001
        unique-id-format %[src,map(addr.lst)]
        log-format %[src,map(addr.lst)]
        use_backend %[src,map(addr.lst)]

The reason stems from the initial introduction of unique IDs in 1.5 via
commit af5a29d5f ("MINOR: pattern: Each pattern is identified by unique
id.") : the unique_id assignment was done before calling
check_config_validity() so all maps loaded after this call are not
properly configured. From what the function does, it seems they will not
be able to use a cache, will not have a unique_id assigned and will not
be updatable from the CLI.

This fix must be backported to all supported versions.
src/haproxy.c