cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/2] git commit: Remove nodes in total on restart. Patch by brandonwilliams, reviewed by Vijay for CASSANDRA-4840
Date Fri, 02 Nov 2012 13:15:35 GMT
Remove nodes in total on restart.
Patch by brandonwilliams, reviewed by Vijay for CASSANDRA-4840


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/110f69c3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/110f69c3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/110f69c3

Branch: refs/heads/trunk
Commit: 110f69c3b857483162c7e86c7ad63061a13dab7f
Parents: 239d66f
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Nov 2 08:13:10 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Nov 2 08:13:10 2012 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java    |    1 +
 .../org/apache/cassandra/net/MessagingService.java |   12 ++++++++++++
 .../apache/cassandra/service/StorageService.java   |    4 +++-
 3 files changed, 16 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/110f69c3/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 53a38fc..813c4c6 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -316,6 +316,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         FailureDetector.instance.remove(endpoint);
         versions.remove(endpoint);
         quarantineEndpoint(endpoint);
+        MessagingService.instance().destroyConnectionPool(endpoint);
         if (logger.isDebugEnabled())
             logger.debug("removing endpoint " + endpoint);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/110f69c3/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index 4f6aaf5..c8c2cc1 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -298,6 +298,18 @@ public final class MessagingService implements MessagingServiceMBean
         }
     }
 
+    public void destroyConnectionPool(InetAddress to)
+    {
+        OutboundTcpConnectionPool cp = connectionManagers_.get(to);
+        if (to == null)
+            return;
+        cp.ackCon.closeSocket();
+        cp.cmdCon.closeSocket();
+        connectionManagers_.remove(to);
+        recentTimeoutsPerHost.remove(to.getHostAddress());
+        timeoutsPerHost.remove(to.getHostAddress());
+    }
+
     public OutboundTcpConnectionPool getConnectionPool(InetAddress to)
     {
         OutboundTcpConnectionPool cp = connectionManagers_.get(to);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/110f69c3/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 80c3f46..30da45c 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1273,7 +1273,9 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
                 // grab any data we are now responsible for and notify responsible node
                 restoreReplicaCount(endpoint, tokenMetadata_.getEndpoint(coordtoken));
             }
-        } // not a member, nothing to do
+        }
+        else // now that the gossiper has told us about this nonexistent member, notify the
gossiper to remove it
+            Gossiper.instance.removeEndpoint(endpoint);
     }
 
     private void excise(Token token, InetAddress endpoint)


Mime
View raw message