Forum Discussion

David_Bradley_2's avatar
David_Bradley_2
Icon for Nimbostratus rankNimbostratus
Apr 10, 2007

LB::reselect not working as expected

I'm got an LB_SELECTED that is checking if the choice made by the LB is acceptable, and doing an LB::reselect if not. I setup an artificial condition in my lab in which no choice is acceptable. Based on the code below, what i'd expect to see is the connection be ultimately rejected after having looped through all the servers in the pool and determined that none of them were acceptable candidates. What i'm actually seeing is the LB::reselect happening twice, and on the second time, it's putting the connection on the server chosen by the LB, not looping to the next one according to the LB algo. (which is round-robin btw). There are 3 servers in the pool. Here is my LB_SELECTED rule:

 

 

when LB_SELECTED {

 

 

If we don't have the capacity to host this client on

 

the selected server, then reselect. If we've gone

 

through all the servers in the list, then reject.

 

 

if { [LB::server ratio] < $client_weight } {

 

if { $retry_count >= [active_members [LB::server pool]] } {

 

log local0. "Found no server of [active_members [LB::server pool]] in pool [LB::server pool] with enough capacity to handle $sender of weight $client_weight. Rejecting connection."

 

reject

 

return

 

} incr retry_count

 

log local0. "LB chose member ([LB::server addr]) with too little capacity ([LB::server ratio]) for sender $sender. Need at least $client_weight. Reselect try number $retry_count."

 

LB::reselect

 

}

 

}

 

 

 

Thanks in advance.

 

 

Dave