cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1177847 - in /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra: gms/Gossiper.java service/StorageService.java
Date Fri, 30 Sep 2011 21:44:11 GMT
Author: brandonwilliams
Date: Fri Sep 30 21:44:10 2011
New Revision: 1177847

URL: http://svn.apache.org/viewvc?rev=1177847&view=rev
Log:
Evict gossip state immediately when a token is taken over.
Patch by vijay, reviewed by brandonwilliams for CASSANDRA-3259

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1177847&r1=1177846&r2=1177847&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java Fri Sep
30 21:44:10 2011
@@ -302,6 +302,17 @@ public class Gossiper implements IFailur
     }
 
     /**
+     * Remove the Endpoint and evict immediately, to avoid gossiping about this node.
+     * This should only be called when a token is taken over by a new IP address.
+     * @param endpoint The endpoint that has been replaced
+     */
+    public void replacedEndpoint(InetAddress endpoint)
+    {
+        removeEndpoint(endpoint);
+        evictFromMembership(endpoint);
+    }
+
+    /**
      * The gossip digest is built based on randomization
      * rather than just looping through the collection of live endpoints.
      *

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java?rev=1177847&r1=1177846&r2=1177847&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
Fri Sep 30 21:44:10 2011
@@ -841,7 +841,7 @@ public class StorageService implements I
             logger_.info(String.format("Nodes %s and %s have the same token %s.  %s is the
new owner",
                                        endpoint, currentOwner, token, endpoint));
             tokenMetadata_.updateNormalToken(token, endpoint);
-            Gossiper.instance.removeEndpoint(currentOwner);
+            Gossiper.instance.replacedEndpoint(currentOwner);
             if (!isClientMode)
                 SystemTable.updateToken(endpoint, token);
         }
@@ -849,6 +849,7 @@ public class StorageService implements I
         {
             logger_.info(String.format("Nodes %s and %s have the same token %s.  Ignoring
%s",
                                        endpoint, currentOwner, token, endpoint));
+            Gossiper.instance.replacedEndpoint(endpoint);
         }
 
         if (tokenMetadata_.isMoving(endpoint)) // if endpoint was moving to a new token



Mime
View raw message