cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/2] git commit: Merge branch 'cassandra-1.1' into trunk
Date Fri, 02 Nov 2012 13:15:35 GMT
Updated Branches:
  refs/heads/trunk 998131635 -> 84e1ed4c6


Merge branch 'cassandra-1.1' into trunk


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

Branch: refs/heads/trunk
Commit: 84e1ed4c6171f3efe41f1596c1340e320ac8d710
Parents: 9981316 110f69c
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Nov 2 08:15:27 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Nov 2 08:15:27 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/84e1ed4c/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/Gossiper.java
index 6c4bf43,813c4c6..e49a6b3
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@@ -276,8 -314,9 +276,9 @@@ public class Gossiper implements IFailu
          unreachableEndpoints.remove(endpoint);
          // do not remove endpointState until the quarantine expires
          FailureDetector.instance.remove(endpoint);
 -        versions.remove(endpoint);
 +        MessagingService.instance().resetVersion(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/84e1ed4c/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/net/MessagingService.java
index 10de977,c8c2cc1..da894e7
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@@ -464,13 -298,25 +464,25 @@@ public final class MessagingService imp
          }
      }
  
+     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);
 +        OutboundTcpConnectionPool cp = connectionManagers.get(to);
          if (cp == null)
          {
 -            connectionManagers_.putIfAbsent(to, new OutboundTcpConnectionPool(to));
 -            cp = connectionManagers_.get(to);
 +            connectionManagers.putIfAbsent(to, new OutboundTcpConnectionPool(to));
 +            cp = connectionManagers.get(to);
          }
          return cp;
      }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/84e1ed4c/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageService.java
index 88abadb,30da45c..6302507
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@@ -1542,14 -1269,16 +1542,16 @@@ public class StorageService implements 
  
                  // find the endpoint coordinating this removal that we need to notify when
we're done
                  String[] coordinator = Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.REMOVAL_COORDINATOR).value.split(VersionedValue.DELIMITER_STR,
-1);
 -                Token coordtoken = getPartitioner().getTokenFactory().fromString(coordinator[1]);
 +                UUID hostId = UUID.fromString(coordinator[1]);
                  // grab any data we are now responsible for and notify responsible node
 -                restoreReplicaCount(endpoint, tokenMetadata_.getEndpoint(coordtoken));
 +                restoreReplicaCount(endpoint, tokenMetadata.getEndpointForHostId(hostId));
              }
-         } // 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)
 +    private void excise(Collection<Token> tokens, InetAddress endpoint)
      {
          HintedHandOffManager.instance.deleteHintsForEndpoint(endpoint);
          Gossiper.instance.removeEndpoint(endpoint);


Mime
View raw message