iRule and persistence behavior with active_members and no persistence set

I have the following iRule to failover requests should there be at least one member of the primary pool down. The failover process works, but when all members come back up in the primary pool the connections are not then sent to the primary pool. Originally I had cookie persistence enabled on the virtual server, but even after setting persistence to none and testing with different “new” connections, all traffic is still sent to the backup pool. Any thoughts on why once it fails over, the VS or iRule continues to believe that traffic should be sent to the backup pool?

when HTTP_REQUEST {
  if { [active_members primary-qa-443_1214-pool] < 2 } {
    pool backup-qa-443_1214-pool
} else {
    pool primary-qa-443_1214-pool
}
}

This article should help shed light on your issue: K9800: Using an iRule to load balance HTTP requests to multiple pools .

Your “new” connection may already have an entry in the connection table. You can try this:

when HTTP_REQUEST {
    catch {LB::detach}
    if { [active_members primary-qa-443_1214-pool] < 2 } {
        pool backup-qa-443_1214-pool
    } else {
        pool primary-qa-443_1214-pool
    }
}