cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject git commit: Revert "Revert "fix broadcastAddress and Ec2MultiRegionSnitch.reconnect patch by Vijay; reviewed by Brandon Williams for CASSANDRA-3835""
Date Thu, 02 Feb 2012 04:54:46 GMT
Updated Branches:
  refs/heads/cassandra-1.0 defe66a16 -> 0074d6491


Revert "Revert "fix broadcastAddress and Ec2MultiRegionSnitch.reconnect patch by Vijay; reviewed
by Brandon Williams for CASSANDRA-3835""

This reverts commit defe66a16a53b29bfaa2193a87f7c7e165938fa9.


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

Branch: refs/heads/cassandra-1.0
Commit: 0074d64915fbff95794ed81263f15d0116b4e8d3
Parents: defe66a
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Wed Feb 1 20:54:30 2012 -0800
Committer: Vijay Parthasarathy <vijay2win@gmail.com>
Committed: Wed Feb 1 20:54:30 2012 -0800

----------------------------------------------------------------------
 src/java/org/apache/cassandra/cli/CliClient.java   |   10 +---------
 src/java/org/apache/cassandra/db/SystemTable.java  |    2 +-
 src/java/org/apache/cassandra/gms/Gossiper.java    |    2 +-
 .../cassandra/net/OutboundTcpConnection.java       |    5 +++++
 .../cassandra/net/OutboundTcpConnectionPool.java   |    6 ++++--
 .../apache/cassandra/service/MigrationManager.java |    2 +-
 6 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/src/java/org/apache/cassandra/cli/CliClient.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliClient.java b/src/java/org/apache/cassandra/cli/CliClient.java
index 61cc53e..6b1e637 100644
--- a/src/java/org/apache/cassandra/cli/CliClient.java
+++ b/src/java/org/apache/cassandra/cli/CliClient.java
@@ -1155,15 +1155,7 @@ public class CliClient
             {
                 SimpleSnitch snitch = new SimpleSnitch();
                 Map<String, String> options = new HashMap<String, String>();
-
-                try
-                {
-                    options.put(snitch.getDatacenter(InetAddress.getLocalHost()), "1");
-                }
-                catch (UnknownHostException e)
-                {
-                    throw new RuntimeException(e);
-                }
+                options.put(snitch.getDatacenter(FBUtilities.getBroadcastAddress()), "1");
 
                 ksDef.setStrategy_options(options);
             }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/src/java/org/apache/cassandra/db/SystemTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemTable.java b/src/java/org/apache/cassandra/db/SystemTable.java
index c831382..7e13fc4 100644
--- a/src/java/org/apache/cassandra/db/SystemTable.java
+++ b/src/java/org/apache/cassandra/db/SystemTable.java
@@ -138,7 +138,7 @@ public class SystemTable
      */
     public static synchronized void updateToken(InetAddress ep, Token token)
     {
-        if (ep == FBUtilities.getLocalAddress())
+        if (ep == FBUtilities.getBroadcastAddress())
         {
             removeToken(token);
             return;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/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 d1a5b8d..96576fb 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -1095,7 +1095,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
      */
     public void addSavedEndpoint(InetAddress ep)
     {
-        if (ep == FBUtilities.getLocalAddress())
+        if (ep == FBUtilities.getBroadcastAddress())
         {
             logger.debug("Attempt to add self as saved endpoint");
             return;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 17c2097..a597aab 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -78,6 +78,11 @@ public class OutboundTcpConnection extends Thread
         enqueue(CLOSE_SENTINEL, null);
     }
 
+    void softCloseSocket()
+    {
+        enqueue(CLOSE_SENTINEL, null);
+    }
+
     public void run()
     {
         while (true)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index c7acd9e..a75dafe 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -68,7 +68,8 @@ public class OutboundTcpConnectionPool
     public void reset(InetAddress remoteEP)
     {
         resetedEndpoint = remoteEP;
-        reset();
+        for (OutboundTcpConnection con : new OutboundTcpConnection[] { cmdCon, ackCon })
+            con.softCloseSocket();
     }
     
     public Socket newSocket() throws IOException
@@ -78,7 +79,8 @@ public class OutboundTcpConnectionPool
         {
             return SSLFactory.getSocket(DatabaseDescriptor.getEncryptionOptions(), endPoint(),
DatabaseDescriptor.getSSLStoragePort(), FBUtilities.getLocalAddress(), 0);
         }
-        else {
+        else 
+        {
             return new Socket(endPoint(), DatabaseDescriptor.getStoragePort(), FBUtilities.getLocalAddress(),
0);
         }
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0074d649/src/java/org/apache/cassandra/service/MigrationManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java b/src/java/org/apache/cassandra/service/MigrationManager.java
index 4f6a5a7..cf0cbcd 100644
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@ -54,7 +54,7 @@ public class MigrationManager implements IEndpointStateChangeSubscriber
     // avoids re-pushing migrations that we're waiting on target to apply already
     private static Map<InetAddress,UUID> lastPushed = new MapMaker().expiration(1,
TimeUnit.MINUTES).makeMap();
     
-    private static UUID highestKnown;
+    private static volatile UUID highestKnown;
 
     public void onJoin(InetAddress endpoint, EndpointState epState) { 
         VersionedValue value = epState.getApplicationState(ApplicationState.SCHEMA);


Mime
View raw message