Bug 33558 - When the master node is enter again, only the first request is not replicated.
Summary: When the master node is enter again, only the first request is not replicated.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina:Cluster (show other bugs)
Version: 5.0.28
Hardware: PC Linux
: P2 normal with 2 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-14 13:47 UTC by Takashi Satou
Modified: 2005-03-03 06:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Satou 2005-02-14 13:47:40 UTC
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) {
Comment 1 Takashi Satou 2005-02-21 05:23:02 UTC
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. 
Comment 2 Filip Hanik 2005-03-03 15:28:30 UTC
I have applied the fix, thanks for bringing this to my attention.