Hi Venkat,
as I said, persistent session are transparently rebalanced to the next active node in the case that the persited node is unhealthy. You could check this behavior by using the iRule below. It uses the
PERSIST_DOWN
event to
[log]
persisted node that have been failed. After
PERSIST_DOWN
has been triggered, a regular
LB_SELECTED
event will occour, where one of the remaining nodes are getting selected...
when PERSIST_DOWN {
log local0.debug "Persistent Node [LB::server addr] is marked as [LB::status]"
set persist_down 1
}
when LB_SELECTED {
if { [info exists persist_down] } then {
log local0.debug "New node selection is [LB::server addr]"
unset -nocomplain persist_down
}
}
To kill even the active session (Remark: Active Session =/= Peristent Sessions) to your backend systems, you have to query the currently [active_members] on every single TCP packet, that is going to be send to your pool members and then trigger a TCP::close or
reject
if the currently selected node is not marked as "online"...
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
if { [active_members -list [LB::server pool]] contains [LB::server addr] } then {
TCP::release
} else {
Use TCP::close to close the connection after the next response
TCP::close
User reject to terminate the request immediately
reject
}
}
Note: Keep in mind, that the iRule above produces a a huge performance overhead, since the SERVER_DATA
event and the containing script block is triggered on every single TCP packet that is send to your pool members.
Cheers, Kai