Whenever I call a JSP, a session is created by the master node(i.e. the node receiving the HTTP req) and replicated to the slave node. And when the master node is down, the request failover to the slave node. However, when the master node is enter again in my cluster and the request failback to the master node, only the first request is not replicated to the slave node. I debug tomcat, and found that when the first repuest calles DeltaSession.setAttribute(), DeltaSession.deltaRequest is null(not init)! Therefore, I made the following patches. --- DeltaManager.java.org 2004-08-29 09:14:12.000000000 +0900 +++ DeltaManager.java 2005-02-14 20:45:21.000000000 +0900 @@ -455,6 +455,7 @@ session.access(); //make sure that the session gets ready to expire if needed session.setAccessCount(0); + session.resetDeltaRequest(); sessions.put(session.getId(), session); } } catch (ClassNotFoundException e) {
I think DeltaRequest already has to be in DeltaSession when setAttribute called before requestCompleted. And this patch works when a master node starts, DeltaRequest of only the session that the replication has been done from a slave node is initialized. The reliability of the session persistence is raised further.
I have applied the fix, thanks for bringing this to my attention.