A solution here was to use source_addr persistence - only gets inserted when there's been a failover and check if there is an active persistence session before directing the tomcat instances to an application server.
when request {
set persistenceRecord [persist lookup source_addr [IP::client_addr]]
if { $persistenceRecord eq "" }{
if {([class match [IP::client_addr] equals dg1]) && ([active_members pool] > 1 )}{
pool pool member 1.1.1.1 [port]
} elseif {([class match [IP::client_addr] equals dg2]) && ([active_members pool] > 1 )} {
pool pool member 2.2.2.2 [port]
} else {
pool pool
persist source_addr ...
Because a persistence record only gets inserted if/when we hit the default else of that block, we maintain those persistence sessions and never fail back + we only ever get into the block if no persistence records exist to begin with.