Fixed bug #355: YAZ proxy does not seem to load balance. Error
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 27 May 2005 18:07:49 +0000 (18:07 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 27 May 2005 18:07:49 +0000 (18:07 +0000)
was caused by seemingly clever logic that choosed backend
with most spares.. But sometimes the one with most spares is
much more used. Now the backend with minimum use is always used.

src/yaz-proxy.cpp

index 594435e..e59613e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy.cpp,v 1.26 2005-05-18 20:15:23 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.27 2005-05-27 18:07:49 adam Exp $
    Copyright (c) 1998-2005, Index Data.
 
 This file is part of the yaz-proxy.
    Copyright (c) 1998-2005, Index Data.
 
 This file is part of the yaz-proxy.
@@ -390,12 +390,6 @@ const char *Yaz_Proxy::load_balance(const char **url)
            max_spare = zurl_in_spare[i];
        }
     }
            max_spare = zurl_in_spare[i];
        }
     }
-    // use the one with minimum connections if spare is > 3
-    if (spare_for_min > 3)
-       return ret_min;
-    // use one with most spares (if any)
-    if (max_spare > 0)
-       return ret_spare;
     return ret_min;
 }
 
     return ret_min;
 }