cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [2/2] git commit: ITC.close() resets peer msg version, causes connection thrashing in ec2 during upgrade. Second pass, where we have Ec2MRS check that the perr node is on the same MS.current_version before closing connection on publicIP and reconnecting
Date Thu, 20 Jun 2013 19:21:24 GMT
ITC.close() resets peer msg version, causes connection thrashing in ec2 during upgrade.
Second pass, where we have Ec2MRS check that the perr node is on the same MS.current_version
before
closing connection on publicIP and reconnecting on privateIP


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

Branch: refs/heads/cassandra-1.2
Commit: 72b1a1b4989212267dba9a8d389af21d24423533
Parents: 8d17ccb
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Thu Jun 20 11:19:44 2013 -0700
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Thu Jun 20 12:15:26 2013 -0700

----------------------------------------------------------------------
 .../cassandra/locator/Ec2MultiRegionSnitch.java | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/72b1a1b4/src/java/org/apache/cassandra/locator/Ec2MultiRegionSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/Ec2MultiRegionSnitch.java b/src/java/org/apache/cassandra/locator/Ec2MultiRegionSnitch.java
index e29637f..12ebfbb 100644
--- a/src/java/org/apache/cassandra/locator/Ec2MultiRegionSnitch.java
+++ b/src/java/org/apache/cassandra/locator/Ec2MultiRegionSnitch.java
@@ -97,17 +97,19 @@ public class Ec2MultiRegionSnitch extends Ec2Snitch implements IEndpointStateCha
 
     private void reConnect(InetAddress endpoint, VersionedValue versionedValue)
     {
-        if (!getDatacenter(endpoint).equals(getDatacenter(public_ip)))
-            return; // do nothing return back...
-
-        try
-        {
-            InetAddress remoteIP = InetAddress.getByName(versionedValue.value);
-            MessagingService.instance().getConnectionPool(endpoint).reset(remoteIP);
-            logger.debug(String.format("Intiated reconnect to an Internal IP %s for the %s",
remoteIP, endpoint));
-        } catch (UnknownHostException e)
+        if (getDatacenter(endpoint).equals(getDatacenter(public_ip))
+            && MessagingService.instance().getVersion(endpoint) == MessagingService.current_version)
         {
-            logger.error("Error in getting the IP address resolved: ", e);
+            try
+            {
+                InetAddress remoteIP = InetAddress.getByName(versionedValue.value);
+                MessagingService.instance().getConnectionPool(endpoint).reset(remoteIP);
+                logger.debug(String.format("Intiated reconnect to an Internal IP %s for the
%s", remoteIP, endpoint));
+            }
+            catch (UnknownHostException e)
+            {
+                logger.error("Error in getting the IP address resolved: ", e);
+            }
         }
     }
 


Mime
View raw message