cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1094694 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java
Date Mon, 18 Apr 2011 18:57:23 GMT
Author: brandonwilliams
Date: Mon Apr 18 18:57:23 2011
New Revision: 1094694

URL: http://svn.apache.org/viewvc?rev=1094694&view=rev
Log:
Revert "Keep endpoint state until aVeryLongTime when not a fat client"

This reverts commit db9164ffd96ebc7752fc5789c90c7211ba323ad2.

For CASSANDRA-2371.

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

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1094694&r1=1094693&r2=1094694&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java Mon Apr
18 18:57:23 2011
@@ -237,18 +237,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)
     {
@@ -258,7 +257,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());
     }
@@ -428,15 +427,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_) )
@@ -456,6 +460,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());
                 }
             }
         }



Mime
View raw message