Author: jfrederic.clere(a)jboss.com
Date: 2008-06-09 04:19:29 -0400 (Mon, 09 Jun 2008)
New Revision: 1670
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange sdandby logic.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-09 07:57:43 UTC
(rev 1669)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-09 08:19:29 UTC
(rev 1670)
@@ -697,8 +697,15 @@
}
if (worker->s->lbset > cur_lbset)
continue;
- if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(worker) :
PROXY_WORKER_IS_STANDBY(worker)) )
+
+ /* standby logic
+ * lbfactor: -1 broken node.
+ * 0 standby.
+ * >0 factor to use.
+ */
+ if (worker->s->lbfactor < 0 || (worker->s->lbfactor == 0
&& !checking_standby))
continue;
+
/* If the worker is in error state run
* retry on that worker. It will be marked as
* operational if the retry timeout is elapsed.
@@ -710,14 +717,11 @@
/* Take into calculation only the workers that are
* not in error state or not disabled.
+ * and that can map the context.
*/
if (PROXY_WORKER_IS_USABLE(worker) && iscontext_host_ok(r,
balancer, worker)) {
- /* XXX: That looks fishy */
- if (worker->s->lbfactor <= 0)
- mytraffic = curmin;
- else
- mytraffic =
(worker->s->transferred/worker->s->lbfactor) +
- (worker->s->read/worker->s->lbfactor);
+ mytraffic = (worker->s->transferred/worker->s->lbfactor)
+
+ (worker->s->read/worker->s->lbfactor);
if (!mycandidate || mytraffic < curmin) {
mycandidate = worker;
curmin = mytraffic;
Show replies by date