tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1805854 - in /tomcat/tc8.5.x/trunk: java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java java/org/apache/catalina/tribes/tipis/LocalStrings.properties webapps/docs/changelog.xml
Date Wed, 23 Aug 2017 06:16:25 GMT
Author: kfujino
Date: Wed Aug 23 06:16:25 2017
New Revision: 1805854

URL: http://svn.apache.org/viewvc?rev=1805854&view=rev
Log:
Avoid Ping timeout until the added map member by receiving MSG_START message is completely
started.

Modified:
    tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/LocalStrings.properties
    tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1805854&r1=1805853&r2=1805854&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
(original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
Wed Aug 23 06:16:25 2017
@@ -279,13 +279,23 @@ public abstract class AbstractReplicated
                     MapMessage mapMsg = (MapMessage)resp[i].getMessage();
                     try {
                         mapMsg.deserialize(getExternalLoaders());
+                        Member member = resp[i].getSource();
                         State state = (State) mapMsg.getValue();
                         if (state.isAvailable()) {
-                            memberAlive(resp[i].getSource());
+                            memberAlive(member);
+                        } else if (state == State.STATETRANSFERRED) {
+                            synchronized (mapMembers) {
+                                if (log.isInfoEnabled())
+                                    log.info(sm.getString("abstractReplicatedMap.ping.stateTransferredMember",
+                                            member));
+                                if (mapMembers.containsKey(member) ) {
+                                    mapMembers.put(member, Long.valueOf(System.currentTimeMillis()));
+                                }
+                            }
                         } else {
                             if (log.isInfoEnabled())
                                 log.info(sm.getString("abstractReplicatedMap.mapMember.unavailable",
-                                        resp[i].getSource()));
+                                        member));
                         }
                     } catch (ClassNotFoundException | IOException e) {
                         log.error(sm.getString("abstractReplicatedMap.unable.deserialize.MapMessage"),
e);
@@ -538,6 +548,7 @@ public abstract class AbstractReplicated
         } catch (ClassNotFoundException x) {
             log.error(sm.getString("abstractReplicatedMap.unable.transferState"), x);
         }
+        this.state = State.STATETRANSFERRED;
     }
 
     /**
@@ -1625,6 +1636,7 @@ public abstract class AbstractReplicated
 
     private static enum State {
         NEW(false),
+        STATETRANSFERRED(false),
         INITIALIZED(true),
         DESTROYED(false);
 

Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/LocalStrings.properties?rev=1805854&r1=1805853&r2=1805854&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/LocalStrings.properties (original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/tipis/LocalStrings.properties Wed
Aug 23 06:16:25 2017
@@ -39,6 +39,7 @@ abstractReplicatedMap.leftOver.pingMsg=P
 abstractReplicatedMap.leftOver.ignored=Message[{0}] is ignored.
 abstractReplicatedMap.mapMember.unavailable=Member[{0}] is not available yet.
 abstractReplicatedMap.ping.timeout=Member[{0}] in the Map[{1}] has timed-out in the ping
processing.
+abstractReplicatedMap.ping.stateTransferredMember=Member[{0}] is state transferred but not
available yet.
 mapMessage.deserialize.error.key=Deserialization error of the MapMessage.key
 mapMessage.deserialize.error.value=Deserialization error of the MapMessage.value
 lazyReplicatedMap.unableReplicate.backup=Unable to replicate backup key:[{0}] to backup:[{1}].
Reason:[{2}]

Modified: tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1805854&r1=1805853&r2=1805854&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Wed Aug 23 06:16:25 2017
@@ -125,6 +125,10 @@
         Add member info to the log message when the failure detection check
         fails in <code>TcpFailureDetector</code>. (kfujino)
       </fix>
+      <fix>
+        Avoid Ping timeout until the added map member by receiving
+        <code>MSG_START</code> message is completely started. (kfujino)
+      </fix>
     </changelog>
   </subsection>
 </section>



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


Mime
View raw message