Forum Discussion

oliverneubauer_'s avatar
oliverneubauer_
Icon for Nimbostratus rankNimbostratus
Feb 12, 2011

seamless failover with custom persistence

Hi all,

 

 

I'm an irules newbie and I'm trying to get something working in a particular way and I'm stuck.

 

 

 

Basically, I've got a pool of servers that I send a tcp connection to. Persistence is governed by the following irule:

 

 

 

when CLIENT_ACCEPTED {

 

TCP::collect 512

 

}

 

 

 

when CLIENT_DATA {

 

set memid [findstr [TCP::payload] "MEMBERID=" 9 7]

 

if {$memid ne ""} {

 

persist uie $memid

 

}

 

else {

 

persist none

 

log 10.1.31.1 local0.info "no id found in data"

 

}

 

}

 

 

 

 

 

 

This works really well, until the server that the memberid is persisted to is down, but not yet detected by the F5's health monitors (the hash still holds).

 

 

 

In such a case, the connection hangs. If you wait a few seconds and reconnect, a new LB target is hashed to and traffic flows normally.

 

 

 

I've tried adding the following, but it doesn't seem to help (ie does persist uie $memid in PERSIST_DOWN recalculate the hash based on the server pool minus the down host?).

 

 

 

when LB_FAILED {

 

log 10.1.31.1 local0.info "lb failed for request from mid:$memid"

 

LB::reselect

 

}

 

 

 

when PERSIST_DOWN {

 

log 10.1.31.1 local0.info "persistence failed for request from mid: $memid"

 

persist none

 

persist uie $memid

 

}

 

 

 

 

Also, in the pool config, I have specified "Action On Service Down" to be "reselect"

 

 

 

So, is there any way to handle persistence re-selection so that all the client sees is a slight delay rather than a hanging tcp session? I would also be ok if the broken-persistence connection simply went to *any* host in the pool, just so long as it's handled. The persistence is there to help local host caching efficiency, so the occasional slip is acceptable.

 

 

 

Thanks for any help and insight.

 

No RepliesBe the first to reply