Nevermind.  I solved my problem by having the backend save the sessionDB server 
id in its SESSION_ID cookie.  If the SESSION_ID cookie isn't the same server id 
as the localhost sessionDB, it knows a change has been made and it will first 
copy the session data out of the read-only slave sessionDB to the localhost 
sessionDB (updating the SESSION_ID cookie) before proceeding to handle the 
request.

On Jan 3, 2013, at 12:47 PM, Kevin Heatwole <ke...@heatwoles.us> wrote:

> I'm thinking of using cookie persistence to stick a user to the same backend 
> (if available) for all requests coming from the user.
> 
> But, I need to handle the case where HAProxy switches the user to a different 
> backend (because the original backend has gone offline or MAXCONN reached) 
> than the one saved in the cookie.  
> 
> My question is:  Can the backends tell when the frontend has changed to a new 
> backend server than the one saved in the cookie?
> 
> I assume so, but I'm wondering how to do this.  Have the backend save the 
> frontend cookie value in another cookie, if the frontend cookie has changed?  
> Or, is it simpler than this and the frontend can set a request attribute 
> (X-Server-Changed?) that the backend simply checks?
> 
> I need to copy previous session data to the new backend sessionDB (from the 
> slave sessionDB backup) to continue processing the user requests 
> uninterrupted on the new backend.
> 
> Kevin
> 
> 


Reply via email to