If a cluster of nodes is being load balanced with sticky sessions, and a particular node becomes unavailable, any sessions bound to that node must be redistributed. Particularly in the case of mod_jk these sessions will not be bound to whichever node the failover occurred on because the jessionid will still contain the JVM route of the original failed node, thus placing the session in an indeterminate state and losing sticky properties. I am attaching a patch that will trigger a session to rebind itself to a new node if the jvmroutes don't match and replace the jessionid in the browser's cookie.
Created attachment 18890 [details] Recommended patch
A slightly modified version of your patch has been applied to SVN and will be included in 5.5.21 onwards. Many thanks for the patch.
Re-opening to change resolution type.
As per the discussion on the dev list - http://marc.theaimsgroup.com/?t=116592092300008&r=1&w=2 - this patch will nto be commmitted. The JvmRouteBinderValve should provide the functionality you require in this case.
Created attachment 19470 [details] Additional strings for StringManager Added an additional string for logging
Created attachment 19471 [details] Modifications to JvmRouteBinderValve Modifications made to JvmRouteBinderValve to make it agnostic of whether or not in-memory clusting is being used.
Please reopen and investigate this bug. I have made the modifications to the JvmRouteBinderValve as per the discussion on the dev mailing list. My initial testing shows this valve now works as expected for JDBC clustering.
Filip, what do you think about the patch as it is right now, for Tomcat 5.5 (not 6.0)?
I have applied a modified fix to trunk and proposed it for 6.0.x and 5.5.x
This has been applied to 6.0.x and 5.5.x and will be included in 6.0.21 and 5.5.28 onwards.