You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proxy_info("No available server in hostgroup %u with weight > 0, but %u candidates found. This is probably due to max_connections reached for all servers. Using candidates with weight 0\n", hid, num_candidates);
1979
-
// Iterate on all candidates and increase their weight
1980
-
for (j=0; j<num_candidates; j++) {
1981
-
mysrvc = mysrvcCandidates[j];
1982
-
// increase the weight of the server
1983
-
mysrvc->weight++;
1984
-
proxy_debug("Increasing weight of server %s:%d to %ld\n", mysrvc->address, mysrvc->port, mysrvc->weight);
1985
-
sum += 1;
1986
-
}
1987
-
}
1988
1977
if (sum==0) {
1989
1978
// per issue #531 , we try a desperate attempt to bring back online any shunned server
1990
1979
// we do this lowering the maximum wait time to 10%
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning PgSQL_SrvC NULL because no backend ONLINE or with weight\n");
2049
-
if (l>32) {
2050
-
free(mysrvcCandidates);
2038
+
if (num_candidates==0) {
2039
+
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning PgSQL_SrvC NULL because no backend ONLINE or with weight\n");
2040
+
if (l>32) {
2041
+
free(mysrvcCandidates);
2042
+
}
2043
+
#ifdef TEST_AURORA
2044
+
array_mysrvc_cands += num_candidates;
2045
+
#endif// TEST_AURORA
2046
+
returnNULL; // if we reach here, we couldn't find any target
2051
2047
}
2052
-
#ifdef TEST_AURORA
2053
-
array_mysrvc_cands += num_candidates;
2054
-
#endif// TEST_AURORA
2055
-
returnNULL; // if we reach here, we couldn't find any target
2048
+
// All servers have weight 0, but we have some candidates - pick a random one (assume they all have weight 1)
2049
+
proxy_info("No available server in hostgroup %u with weight > 0, but %u candidates found. This is probably due to max_connections reached for all servers. Using candidates with weight 0\n", hid, num_candidates);
0 commit comments