You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/02/15 21:51:35 UTC

svn commit: r1071049 - /cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java

Author: jbellis
Date: Tue Feb 15 20:51:34 2011
New Revision: 1071049

URL: http://svn.apache.org/viewvc?rev=1071049&view=rev
Log:
revert #2115

Modified:
    cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java

Modified: cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1071049&r1=1071048&r2=1071049&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/branches/cassandra-0.7.2/src/java/org/apache/cassandra/gms/Gossiper.java Tue Feb 15 20:51:34 2011
@@ -235,18 +235,17 @@ public class Gossiper implements IFailur
     }
 
     /**
-     * Removes the endpoint from gossip completely
+     * Removes the endpoint from unreachable endpoint set
      *
      * @param endpoint endpoint to be removed from the current membership.
     */
     void evictFromMembership(InetAddress endpoint)
     {
         unreachableEndpoints_.remove(endpoint);
-        endpointStateMap_.remove(endpoint);
     }
 
     /**
-     * Removes the endpoint from Gossip but retains endpoint state
+     * Removes the endpoint completely from Gossip
      */
     public void removeEndpoint(InetAddress endpoint)
     {
@@ -256,7 +255,7 @@ public class Gossiper implements IFailur
 
         liveEndpoints_.remove(endpoint);
         unreachableEndpoints_.remove(endpoint);
-        // do not remove endpointState until aVeryLongTime
+        // do not remove endpointState until the quarantine expires
         FailureDetector.instance.remove(endpoint);
         justRemovedEndpoints_.put(endpoint, System.currentTimeMillis());
     }
@@ -426,15 +425,20 @@ public class Gossiper implements IFailur
             {
                 long duration = now - epState.getUpdateTimestamp();
 
-                if (StorageService.instance.getTokenMetadata().isMember(endpoint))
-                    epState.setHasToken(true);
                 // check if this is a fat client. fat clients are removed automatically from
                 // gosip after FatClientTimeout
-                if (!epState.getHasToken() && !epState.isAlive() && !justRemovedEndpoints_.containsKey(endpoint) && (duration > FatClientTimeout_))
+                if (!epState.getHasToken() && !epState.isAlive() && (duration > FatClientTimeout_))
                 {
-                    logger_.info("FatClient " + endpoint + " has been silent for " + FatClientTimeout_ + "ms, removing from gossip");
-                    removeEndpoint(endpoint); // will put it in justRemovedEndpoints to respect quarantine delay
-                    evictFromMembership(endpoint); // can get rid of the state immediately
+                    if (StorageService.instance.getTokenMetadata().isMember(endpoint))
+                        epState.setHasToken(true);
+                    else
+                    {
+                        if (!justRemovedEndpoints_.containsKey(endpoint)) // if the node was decommissioned, it will have been removed but still appear as a fat client
+                        {
+                            logger_.info("FatClient " + endpoint + " has been silent for " + FatClientTimeout_ + "ms, removing from gossip");
+                            removeEndpoint(endpoint); // after quarantine justRemoveEndpoints will remove the state
+                        }
+                    }
                 }
 
                 if ( !epState.isAlive() && (duration > aVeryLongTime_) )
@@ -454,6 +458,7 @@ public class Gossiper implements IFailur
                     if (logger_.isDebugEnabled())
                         logger_.debug(QUARANTINE_DELAY + " elapsed, " + entry.getKey() + " gossip quarantine over");
                     justRemovedEndpoints_.remove(entry.getKey());
+                    endpointStateMap_.remove(entry.getKey());
                 }
             }
         }