Bug 47515 - Tomcat can't replicate session when it is started.
Tomcat can't replicate session when it is started.
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
6.0.18
PC All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-07-12 23:08 UTC by Ryuichi Yoshihara
Modified: 2009-07-16 07:12 UTC (History)
1 user (show)



Attachments
DeltaManager's patch (816 bytes, patch)
2009-07-13 17:23 UTC, Ryuichi Yoshihara
Details | Diff
DeltaManager's patch (820 bytes, patch)
2009-07-13 18:02 UTC, Ryuichi Yoshihara
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryuichi Yoshihara 2009-07-12 23:08:36 UTC
System
  two Tomcat Server(AP1,AP2)
  Tomcat's version is 6.0.18.
  Replication method is Delta Manager
 
 I stopped Tomcat of AP1.
 Then, I restarted Tomcat of AP1.
 Then, for AP1, Tomcat's log is as follows.
 
  Jul 2, 2009 4:51:04 PM
  org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
  WARNING: Manager [/tpcw]: Drop message SESSION-DELTA
  inside GET_ALL_SESSIONS sync phase start date 7/2/09 4:51 PM message date 1/1/70 9:00 AM
  
  Jul 2, 2009 4:51:04 PM
  org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
  WARNING: Manager [/tpcw]: Drop message SESSION-ACCESSED
  inside GET_ALL_SESSIONS sync phase start date 7/2/09 4:51 PM message date 1/1/70 9:00 AM
  
 TimeStamp is incorrect when SESSION-DELTA or SESSION-ACCESSED because "1/1/70 9:00 AM" isn't created time of session.
 In this case, AP1's Tomcat may drop all session data.
 As a result, AP1's Tomcat can't replicate session.
 If TimeStamp is updated when update last replicated time, it goes well.
 
 I made patch.
 
 DeltaManager's patch.
 
Index: java/org/apache/catalina/ha/session/DeltaManager.java
===================================================================
--- java/org/apache/catalina/ha/session/DeltaManager.java	(revision 792004)
+++ java/org/apache/catalina/ha/session/DeltaManager.java	(working copy)
@@ -1162,7 +1162,10 @@
             }
 
             //update last replicated time
-            if (msg != null) session.setLastTimeReplicated(System.currentTimeMillis());
+            if (msg != null){
+            	session.setLastTimeReplicated(System.currentTimeMillis());
+            	msg.setTimestamp(session.getLastTimeReplicated());
+            }
             return msg;
         } catch (IOException x) {
             log.error(sm.getString("deltaManager.createMessage.unableCreateDeltaRequest",sessionId), x);
Comment 1 Filip Hanik 2009-07-13 12:41:22 UTC
Many thanks, can you please attach the patch as an attachment as line breaks get inserted into your copy paste
Comment 2 Ryuichi Yoshihara 2009-07-13 17:23:30 UTC
Created attachment 23972 [details]
DeltaManager's patch

 Sorry.

 This is the patch for DeltaManager.

 Best regards.
Comment 3 Ryuichi Yoshihara 2009-07-13 18:02:10 UTC
Created attachment 23973 [details]
DeltaManager's patch

Sorry, I miss the patch.

This is the patch for DeltaManager.

Best regards.
Comment 4 Filip Hanik 2009-07-16 07:12:50 UTC
Fixed in trunk
Revision 794684
Proposed for backport to 6.0