Add bias value to server score calculations
By biasing the values of all counter type scores to positive integers, the server weights are always taken into use. This fixes the case when weights were ignored until all score base values were larger than zero (the mxs922_server test).
This commit is contained in:
@ -367,8 +367,8 @@ static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* instance, MXS_SESSION* session
|
||||
candidate = ref;
|
||||
}
|
||||
}
|
||||
else if (ref->connections / ref->server_weight
|
||||
< candidate->connections / candidate->server_weight)
|
||||
else if ((ref->connections + 1) / ref->server_weight
|
||||
< (candidate->connections + 1) / candidate->server_weight)
|
||||
{
|
||||
/* ref has a better score. */
|
||||
candidate = ref;
|
||||
|
||||
Reference in New Issue
Block a user