You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2013/06/20 21:21:24 UTC

[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

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 <ja...@gmail.com>
Authored: Thu Jun 20 11:19:44 2013 -0700
Committer: Jason Brown <ja...@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);
+            }
         }
     }