>>
>> URL: http://svn.apache.org/viewvc?rev=996778&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49924
>> When non-primary node changes into a primary node, make sure 
>> isPrimarySession is changed to true.
>>
>> Modified:
>>    tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java
>>    
>> tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
>
> I may be wrong, but the change to this file appears to be nothing to
> do with the SVN log message.
>
> Looks like a separate change was accidentally committed.
>

When a primary node is stopped, it becomes the following.

======
sessionA(Primary node=Tomcat1, Backup node=Tomcat2, Proxy node=Tomcat3)
Tomcat1 DeltaSession#isPrimarySession:true
Tomcat2 DeltaSession#isPrimarySession:false
Tomcat3 is Proxy.

Tomcat1 stopped.

sessionA(Primary node=Tomcat2, Backup node=Tomcat3, Proxy node=no node)
Tomcat2 DeltaSession#isPrimarySession:false
Tomcat3 DeltaSession#isPrimarySession:false
======

DeltaSession#isPrimarySession is false though the node changes from
the backup into primary.
We should change isPrimarySession to true.

I did the following corrections to this problem.
Because after the backup node is promoted to a primary node,
MapOwner#objectMadePrimay is called,
I added "setPrimarySession(true)" to
MapOwner(BackupManager)#objectMadePrimay method.
As a result, DeltaSession#isPrimarySession of Tomcat2 is changed to true.

Additionally,
I added "getMapOwner().objectMadePrimay(key, entry.getValue());" to
AbstractReplicatedMap#get
so that when we get a non-primary session, isPrimarySession change to true.

I think that isPrimarySession is changed to true in this rev.
Where of this rev is the problem?


-- 
Keiichi.Fujino

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to