]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] differentiate between generic LB params and map-specific ones
authorWilly Tarreau <w@1wt.eu>
Thu, 15 Nov 2007 22:26:18 +0000 (23:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Nov 2007 13:23:10 +0000 (14:23 +0100)
commit206970449231fd25112d10b11e5fce18f0bdcf14
tree7aff04b4a8c6b480368cd3f8bb8342b73f245a7d
parentbe68e6a437d223d88ac4016585de87651b5011f4
[MEDIUM] differentiate between generic LB params and map-specific ones

Since the introduction of server weights, all load balancing algorithms
relied on a pre-computed map. Incidently, quite a bunch of map-specific
parameters were used at random places in order to get the number of
servers or their total weight. It was not architecturally acceptable
that optimizations for the map computation had impact on external parts.
For instance, during this cleanup it was found that a backend weight was
seen as 1 when only the first backup server is used, whatever its weight.

This cleanup consists in differentiating between LB-generic parameters,
such as total weights, number of servers, etc... and map-specific ones.
The struct proxy has been enhanced in order to make it easier to later
support other algorithms. The recount_servers() function now also
updates generic values such as total weights so that it's not needed
anymore to call recalc_server_map() when weights are needed. This
permitted to simplify some code which does not need to know about map
internals anymore.
include/proto/backend.h
include/types/proxy.h
src/backend.c
src/cfgparse.c
src/checks.c
src/dumpstats.c