Author: kfujino
Date: Tue Oct  5 05:31:37 2010
New Revision: 1004526

URL: http://svn.apache.org/viewvc?rev=1004526&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/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java
    
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1004526&r1=1004525&r2=1004526&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Oct  5 05:31:37 2010
@@ -146,23 +146,6 @@ PATCHES PROPOSED TO BACKPORT:
    kkolinko: A bit hard to understand. The proposal is about a rule that 
processes
     <Context>, but LifecycleListenerRule is used for <Engine> and <Host> as 
well.
 
-* 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.
-  http://svn.apache.org/viewvc?view=revision&revision=996778
-  http://svn.apache.org/viewvc?rev=1002935&view=rev
-  +1: kfujino, markt, kkolinko
-  -1:
-   kkolinko: I think getMapOwner().objectMadePrimay(key, entry.getValue()); can
-    throw an NPE. Can the mapOwner be null?
-     kfujino : mapOwner is specified by the argument of the constructor of 
AbstractReplicatedMap.
-       LazyReplicatedMap is constructed  specifying "this" in 
BackupManager#startInternal().
-       Therefore, I think mapOwner can not be null.
-     kkolinko: LazyReplicatedMap is constructed  specifying "null" in 
o.a.c.tribes.demos.MapDemo
-       The other call to objectMadePrimay() (in 
AbstractReplicatedMap.memberDisappeared(..)) checks for null:
-         if ( mapOwner!=null ) 
mapOwner.objectMadePrimay(entry.getKey(),entry.getValue());
-     kfujino: I see, I'll add check for null.
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49209
   Prevent possible AccessControlException during undeployment when running with
   a security manager

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java?rev=1004526&r1=1004525&r2=1004526&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/session/BackupManager.java 
Tue Oct  5 05:31:37 2010
@@ -141,6 +141,7 @@ public class BackupManager extends Stand
             DeltaSession session = (DeltaSession)value;
             synchronized (session) {
                 session.access();
+                session.setPrimarySession(true);
                 session.endAccess();
             }
         }

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1004526&r1=1004525&r2=1004526&view=diff
==============================================================================
--- 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
 (original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
 Tue Oct  5 05:31:37 2010
@@ -879,12 +879,16 @@ public abstract class AbstractReplicated
                     if ( dest!=null && dest.length >0) {
                         getChannel().send(dest, msg, getChannelSendOptions());
                     }
+                    if ( entry.getValue() != null && entry.getValue() 
instanceof ReplicatedMapEntry ) {
+                        ReplicatedMapEntry val = 
(ReplicatedMapEntry)entry.getValue();
+                        val.setOwner(getMapOwner());   
+                    }
                 }
                 entry.setPrimary(channel.getLocalMember(false));
                 entry.setBackupNodes(backup);
                 entry.setBackup(false);
                 entry.setProxy(false);
-
+                if ( getMapOwner()!=null ) getMapOwner().objectMadePrimay(key, 
entry.getValue());
 
             } catch (Exception x) {
                 log.error("Unable to replicate out data for a 
LazyReplicatedMap.get operation", x);
@@ -892,12 +896,6 @@ public abstract class AbstractReplicated
             }
         }
         if (log.isTraceEnabled()) log.trace("Requesting id:"+key+" 
result:"+entry.getValue());
-        if ( entry.getValue() != null && entry.getValue() instanceof 
ReplicatedMapEntry ) {
-            ReplicatedMapEntry val = (ReplicatedMapEntry)entry.getValue();
-            //hack, somehow this is not being set above
-            val.setOwner(getMapOwner());
-            
-        }
         return entry.getValue();
     }    
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1004526&r1=1004525&r2=1004526&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Oct  5 05:31:37 2010
@@ -164,6 +164,10 @@
         logs the stack trace but doesn't do anything to deal with the failure).
         (markt)
       </fix>
+      <fix>
+        <bug>49924</bug>: When non-primary node changes into a primary node,
+        make sure isPrimarySession is changed to true. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Webapps">



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

Reply via email to