Greetings,

Using "stick on src table mypeers/stickysrc" in a backend results in HAProxy 
deciding not to bind to the appropriate peers address for the local host (i.e. 
HAProxy thinks there are no stick tables in use). However using a http-request 
track-sc0 line will result in haproxy listening on the peers address. Also, 
defining the stick table in the backend itself or in a dummy backend also works.

The configuration below illustrates the issue:
peers mypeers
        bind 159.65.21.107:1024
        #peer hpx01 159.65.21.142:1024
        #peer hpx02 159.65.21.107:1024
        server hpx01 159.65.21.142:1024
        server hpx02
        table src_tracking type string size 10m store 
http_req_rate(10s),http_req_cnt
        table stickysrc type ip size 1m expire 1h store gpc0

listen ft_main
        mode http
        bind *:80
        stick on src table mypeers/stickysrc #peers mypeers #DOES NOT WORK
        #stick-table type ip size 1m expire 1h store gpc0 peers mypeers
        #stick on src #WORKS
        #stick on src track_src #WORKS
        #http-request track-sc0 src table mypeers/src_tracking #WORKS
        #http-request track-sc0 src table mypeers/stickysrc    #WORKS
        server local 127.0.0.1:81 check

#backend track_src
#stick-table type ip size 1m expire 1h store gpc0 peers mypeers

Issue affects old (peers) and new (server/bind) peers section syntax. The issue 
only appears where there is only stick tables defined in the peers section - 
defining a dummy backend results in HAProxy binding to the peers socket address.

Limited testing shows that the mypeers/stickysrc isn't being populated on new 
connections either.

Issue reported by duggles on freenode.
The new syntax was introduced in 
[https://github.com/haproxy/haproxy/commit//1b8e68e89a](https://github.com/haproxy/haproxy/commit/1b8e68e89a)

Regards,

Bruno Henc

Reply via email to