Bug 49924 - When non-primary node changes into a primary node, isPrimarySession is not changed to true.
When non-primary node changes into a primary node, isPrimarySession is not ch...
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
6.0.29
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-09-14 03:23 UTC by Keiichi Fujino
Modified: 2010-10-05 01:34 UTC (History)
0 users



Attachments
I made a patch. (2.19 KB, text/plain)
2010-09-14 03:26 UTC, Keiichi Fujino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2010-09-14 03:23:07 UTC
If BackupManager is used,
when a primary node is switched, 
DeltaSession#isPrimarySession is not changed to true. 

Non-primary node changes into a primary node 
when a primary node is stopped or we get a non-primary session. 

If a primary node is stopped, a primary node is switched. 
In AbstractReplicatedMap, when a primary node is switched, 
MapOwner(BackupManager)#objectMadePrimay is called. 
However, isPrimarySession does not change to true in this method. 
=====BackupManager#objectMadePrimay=====
public void objectMadePrimay(Object key, Object value) {
    if (value!=null && value instanceof DeltaSession) {
        DeltaSession session = (DeltaSession)value;
        synchronized (session) {
            session.access();
            session.endAccess();
        }
    }
}
=====

If we get a non-primary session,  a primary node is switched. 
However, isPrimarySession does not change to true. 
It is only a change of primary node.

I made a patch.
It contains the following. 
isPrimarySession is set to true in BackupManager#objectMadePrimay.
When get() is called in non-primary node, MapOwner#objectMadePrimay is called.


Best regards.
Comment 1 Keiichi Fujino 2010-09-14 03:26:53 UTC
Created attachment 26024 [details]
I made a patch.
Comment 2 Keiichi Fujino 2010-09-14 03:50:54 UTC
Fixed in trunk and proposed for 6.0.x
Comment 3 Keiichi Fujino 2010-10-05 01:34:45 UTC
This fix applied to 6.0, will be in 6.0.30 onwards.