Merge branch '2.1.7' into develop-2.1-merge

This commit is contained in:
Johan Wikman
2017-09-12 11:08:02 +03:00
28 changed files with 367 additions and 90 deletions

View File

@ -312,7 +312,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
*/
for (SERVER_REF *ref = inst->service->dbref; ref; ref = ref->next)
{
if (!SERVER_REF_IS_ACTIVE(ref) || SERVER_IN_MAINT(ref->server) || ref->weight == 0)
if (!SERVER_REF_IS_ACTIVE(ref) || SERVER_IN_MAINT(ref->server))
{
continue;
}
@ -370,6 +370,10 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
{
candidate = ref;
}
else if (ref->weight == 0 || candidate->weight == 0)
{
candidate = ref->weight ? ref : candidate;
}
else if (((ref->connections + 1) * 1000) / ref->weight <
((candidate->connections + 1) * 1000) / candidate->weight)
{