Craig_Jackson_2
Mar 11, 2013Nimbostratus
Limitation on LB::reselect?
I've coded an iRule that's supposed to search for a server that's not on an "avoid" list. I've tried to do this by doing LB::reselect repeatedly until I reach one that's not on the list. However, it's acting like LB::reselect can only select one new server in a given transaction. After that, it stays with the new server, even if LB::reselect is executed again.
Is this how it's supposed to work?
Here is the current text of my LB_SELECTED event:
when LB_SELECTED {
incr css_tries
log local0. "Server [LB::server addr]:[LB::server port] Tries $css_tries Avoid_list \"$css_avoid_list\" Active [active_members -list [LB::server pool]]"
if {[active_members [LB::server pool]] <= 1} {
No use trying
set css_add_header 0
} elseif {[lsearch -exact $css_avoid_list [LB::server addr]:[LB::server port]] >= 0} {
if {$css_tries < [active_members [LB::server pool]]} {
log local0. "On avoid list (try $css_tries), retrying"
LB::detach
LB::reselect
} else {
log local0. "Too many tries ($css_tries)"
Stay with the one we selected. Remember for the response.
set css_add_header 0
}
}
}
Craig Jackson
EBSCO Publishing