haproxy/include/proto
Willy Tarreau 004e045f31 BUG/MAJOR: server: weight calculation fails for map-based algorithms
A crash was reported by Igor at owind when changing a server's weight
on the CLI. Lukas Tribus could reproduce a related bug where setting
a server's weight would result in the new weight being multiplied by
the initial one. The two bugs are the same.

The incorrect weight calculation results in the total farm weight being
larger than what was initially allocated, causing the map index to be out
of bounds on some hashes. It's easy to reproduce using "balance url_param"
with a variable param, or with "balance static-rr".

It appears that the calculation is made at many places and is not always
right and not always wrong the same way. Thus, this patch introduces a
new function "server_recalc_eweight()" which is dedicated to this task
of computing ->eweight from many other elements including uweight and
current time (for slowstart), and all users now switch to use this
function.

The patch is a bit large but the code was not trivially fixable in a way
that could guarantee this situation would not occur anymore. The fix is
much more readable and has been verified to work with all algorithms,
with both consistent and map-based hashes, and even with static-rr.

Slowstart was tested as well, just like enable/disable server.

The same bug is very likely present in 1.4 as well, so the patch will
probably need to be backported eventhough it will not apply as-is.

Thanks to Lukas and Igor for the information they provided to reproduce it.
2013-11-21 15:09:02 +01:00
..
acl.h MAJOR: sample: maintain a per-proxy list of the fetch args to resolve 2013-04-03 02:13:02 +02:00
arg.h MAJOR: sample: maintain a per-proxy list of the fetch args to resolve 2013-04-03 02:13:02 +02:00
auth.h MAJOR: acl: make use of the new sample struct and get rid of acl_test 2012-05-08 20:57:14 +02:00
backend.h REORG/MAJOR: use "struct channel" instead of "struct buffer" 2012-09-02 21:54:55 +02:00
channel.h BUG/MAJOR: http: always ensure response buffer has some room for a response 2013-06-08 13:14:17 +02:00
checks.h MEDIUM: Paramatise functions over the check of a server 2013-11-19 09:35:54 +01:00
compression.h MINOR: compression: CPU usage limit 2012-11-21 02:15:16 +01:00
connection.h BUG/MEDIUM: connection: always update connection flags prior to computing polling 2012-12-17 01:14:25 +01:00
cttproxy.h
dumpstats.h MEDIUM: stats: add proxy name filtering on the statistic page 2013-04-15 22:50:33 +02:00
fd.h OPTIM: poll: optimize fd management functions for low register count CPUs 2012-12-13 23:34:18 +01:00
freq_ctr.h
frontend.h REORG: connection: move the PROXY protocol management to connection.c 2012-10-05 00:32:33 +02:00
hdr_idx.h
lb_chash.h
lb_fas.h MEDIUM: backend: add the 'first' balancing algorithm 2012-02-21 22:27:27 +01:00
lb_fwlc.h
lb_fwrr.h
lb_map.h
listener.h CLEANUP: fix missing include <string.h> in proto/listener.h 2013-06-14 19:52:17 +02:00
log.h MINOR: log: indicate it when some unreliable sample fetches are logged 2013-04-03 02:12:56 +02:00
obj_type.h MINOR: stats: add a few more information on session dump 2012-12-08 17:48:47 +01:00
payload.h MINOR: payload: split smp_fetch_rdp_cookie() 2013-08-01 21:17:13 +02:00
peers.h
pipe.h
port_range.h
proto_http.h MINOR: http: some exported functions were not in the header file 2013-10-23 12:21:38 +02:00
proto_tcp.h MEDIUM: counters: use sc0/sc1/sc2 instead of sc1/sc2/sc3 2013-06-17 15:04:07 +02:00
proto_uxst.h BUG/MEDIUM: stream_interface: restore get_src/get_dst 2012-05-11 16:48:10 +02:00
protocol.h REORG: split "protocols" files into protocol and listener 2012-09-15 22:29:32 +02:00
proxy.h REORG: split "protocols" files into protocol and listener 2012-09-15 22:29:32 +02:00
queue.h
raw_sock.h REORG: connection: rename the data layer the "transport layer" 2012-10-04 22:26:09 +02:00
sample.h MAJOR: sample: maintain a per-proxy list of the fetch args to resolve 2013-04-03 02:13:02 +02:00
server.h BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
session.h MINOR: session: make the number of stick counter entries more configurable 2013-08-01 21:17:14 +02:00
shctx.h MINOR: ssl: Setting global tune.ssl.cachesize value to 0 disables SSL session cache. 2012-12-28 14:48:13 +01:00
signal.h CLEANUP: includes: fix includes for a number of users of fd.h 2012-09-03 20:49:14 +02:00
ssl_sock.h MEDIUM: log: report SSL ciphers and version in logs using logformat %sslc/%sslv 2012-10-12 20:48:51 +02:00
stick_table.h MEDIUM: stick-tables: flush old entries upon soft-stop 2013-09-04 17:54:01 +02:00
stream_interface.h MINOR: stats: add a few more information on session dump 2012-12-08 17:48:47 +01:00
task.h
template.h