cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1169823 - in /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra: gms/Gossiper.java net/IncomingTcpConnection.java net/OutboundTcpConnection.java
Date Mon, 12 Sep 2011 16:42:36 GMT
Author: brandonwilliams
Date: Mon Sep 12 16:42:36 2011
New Revision: 1169823

URL: http://svn.apache.org/viewvc?rev=1169823&view=rev
Log:
Make IncomingTcpConnection responsible for version handling.
Patch by Marcus Erikkson, reviewed by Peter Schuller and brandonwilliams
for CASSANDRA-3166

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/OutboundTcpConnection.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1169823&r1=1169822&r2=1169823&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/gms/Gossiper.java Mon Sep
12 16:42:36 2011
@@ -194,11 +194,13 @@ public class Gossiper implements IFailur
     
     public void setVersion(InetAddress address, int version)
     {
+        logger.debug("Setting version {} for {}", version, address);
         versions.put(address, version);
     }
     
     public void resetVersion(InetAddress endpoint)
     {
+        logger.debug("Reseting version for {}", endpoint);
         versions.remove(endpoint);
     }
 

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/IncomingTcpConnection.java?rev=1169823&r1=1169822&r2=1169823&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
Mon Sep 12 16:42:36 2011
@@ -158,6 +158,8 @@ public class IncomingTcpConnection exten
 
     private void close()
     {
+        // reset version here, since we set when starting an incoming socket
+        Gossiper.instance.resetVersion(socket.getInetAddress());
         try
         {
             socket.close();

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/OutboundTcpConnection.java?rev=1169823&r1=1169822&r2=1169823&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
Mon Sep 12 16:42:36 2011
@@ -139,9 +139,6 @@ public class OutboundTcpConnection exten
             output = null;
             socket = null;
         }
-
-        // when we see the node again, try to connect at the most recent protocol we know
about
-        Gossiper.instance.resetVersion(endpoint);
     }
 
     private ByteBuffer take()



Mime
View raw message