haproxy/include/types
Godbach a34bdc0ea4 BUG/MEDIUM: server: set the macro for server's max weight SRV_UWGHT_MAX to SRV_UWGHT_RANGE
The max weight of server is 256 now, but SRV_UWGHT_MAX is still 255. As a result,
FWRR will not work well when server's weight is 256. The description is as below:

There are some macros related to server's weight in include/types/server.h:
    #define SRV_UWGHT_RANGE 256
    #define SRV_UWGHT_MAX   (SRV_UWGHT_RANGE - 1)
    #define SRV_EWGHT_MAX   (SRV_UWGHT_MAX   * BE_WEIGHT_SCALE)

Since weight of server can be reach to 256 and BE_WEIGHT_SCALE equals to 16,
the max eweight of server should be 256*16 = 4096, it will exceed SRV_EWGHT_MAX
which equals to SRV_UWGHT_MAX*BE_WEIGHT_SCALE = 255*16 = 4080. When a server
with weight 256 is insterted into FWRR tree during initialization, the key value
of this server should be SRV_EWGHT_MAX - s->eweight = 4080 - 4096 = -16 which
is closed to UINT_MAX in unsigned type, so the server with highest weight will
be not elected as the first server to process request.

In addition, it is a better choice to compare with SRV_UWGHT_MAX than a magic
number 256 while doing check for the weight. The max number of servers for
round-robin algorithm is also updated.

Signed-off-by: Godbach <nylzhaowei@gmail.com>
2013-07-22 09:29:34 +02:00
..
acl.h MEDIUM: acl: have a pointer to the keyword name in acl_expr 2013-04-03 02:13:01 +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 [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
backend.h BUG/MEDIUM: server: set the macro for server's max weight SRV_UWGHT_MAX to SRV_UWGHT_RANGE 2013-07-22 09:29:34 +02:00
capture.h [MAJOR] last bunch of capture changes for mempool v2 2007-05-13 22:46:04 +02:00
channel.h CLEANUP: channel: remove any reference of the hijackers 2012-11-11 23:05:39 +01:00
checks.h CLEANUP: protect checks.h from multiple inclusions 2013-06-14 19:53:02 +02:00
compression.h MEDIUM: compression: use pool for comp_ctx 2012-11-21 01:56:47 +01:00
connection.h REORG: tproxy: prepare the transparent proxy defines for accepting other OSes 2013-05-11 08:03:37 +02:00
counters.h MINOR: stats: report the total number of compressed responses per front/back 2012-11-24 14:54:13 +01:00
fd.h MAJOR: polling: remove unused callbacks from the poller struct 2012-11-11 21:02:34 +01:00
freq_ctr.h [MINOR] freq_ctr: add new types and functions for periods different from 1s 2010-08-10 14:01:09 +02:00
global.h MINOR: ssl: add a global tunable for the max SSL/TLS record size 2013-02-21 07:53:13 +01:00
hdr_idx.h [BUG] files were missing for hdr_idx in previous commit 2006-12-04 02:20:02 +01:00
lb_chash.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_fas.h MEDIUM: backend: add the 'first' balancing algorithm 2012-02-21 22:27:27 +01:00
lb_fwlc.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_fwrr.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_map.h [CLEANUP] proxy: move last lb-specific bits to their respective files 2009-10-03 18:41:18 +02:00
listener.h MINOR: ssl: add support for the "alpn" bind keyword 2013-04-03 02:13:02 +02:00
log.h BUG/MINOR: log: make log-format, unique-id-format and add-header more independant 2012-12-28 09:51:00 +01:00
obj_type.h MAJOR: connection: replace struct target with a pointer to an enum 2012-11-12 00:42:33 +01:00
peers.h MEDIUM: checks: Add agent health check 2013-02-13 11:03:28 +01:00
pipe.h [MEDIUM] introduce pipe pools 2009-01-25 13:49:53 +01:00
port_range.h [MEDIUM] add support for binding to source port ranges during connect 2009-06-10 12:23:32 +02:00
proto_http.h MEDIUM: http: add the "set-mark" action on http-request/http-response rules 2013-06-11 19:34:13 +02:00
proto_tcp.h MEDIUM: counters: use sc0/sc1/sc2 instead of sc1/sc2/sc3 2013-06-17 15:04:07 +02:00
protocol.h MEDIUM: protocol: implement a "drain" function in protocol layers 2013-06-10 20:33:23 +02:00
proxy.h MEDIUM: http: add a new "http-response" ruleset 2013-06-11 16:06:12 +02:00
queue.h [MAJOR] ported pendconn to mempools v2 2007-05-13 20:19:55 +02:00
sample.h MINOR: sample: provide a function to report the name of a sample check point 2013-04-03 02:13:00 +02:00
server.h BUG/MEDIUM: server: set the macro for server's max weight SRV_UWGHT_MAX to SRV_UWGHT_RANGE 2013-07-22 09:29:34 +02:00
session.h CLEANUP: session: remove event_accept() which was not used anymore 2013-06-20 08:07:35 +02:00
signal.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
ssl_sock.h MEDIUM: ssl: improve crt-list format to support negation 2013-05-07 22:11:54 +02:00
stick_table.h MEDIUM: counters: add a new "gpc0_rate" counter in stick-tables 2013-05-29 15:54:14 +02:00
stream_interface.h MEDIUM: stats: add proxy name filtering on the statistic page 2013-04-15 22:50:33 +02:00
task.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
template.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00