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