cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r993151 - in /cassandra/trunk: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ interface/thrift/gen-py/ src/java/org/apache/cassandra/gms/ src/java/org/apache/cassandra/locator/ src/java/org/apache/cassandra/net/ src/java/org/apac...
Date Mon, 06 Sep 2010 20:56:07 GMT
Author: jbellis
Date: Mon Sep  6 20:56:06 2010
New Revision: 993151

URL: http://svn.apache.org/viewvc?rev=993151&view=rev
Log:
merge from 0.6

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-py/   (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/IEndpointStateChangeSubscriber.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java
    cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
    cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
    cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6:922689-992332
+/cassandra/branches/cassandra-0.6:922689-993148
 /cassandra/trunk:978791
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Mon Sep  6 20:56:06 2010
@@ -51,6 +51,9 @@ dev
    (CASSANDRA-1368)
  * Move persistent sstable stats from the system table to an sstable component
    (CASSANDRA-1430)
+ * remove failed bootstrap attempt from pending ranges when gossip times
+   it out after 1h (CASSANDRA-1463)
+ * eager-create tcp connections to other cluster members (CASSANDRA-1465)
  * apply reversed flag during collation from different data sources
    (CASSANDRA-1450)
 

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-992332
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-993148
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-992332
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-993148
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-992332
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-993148
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-992332
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-993148
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-992332
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-993148
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:978791
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-py/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 20:56:06 2010
@@ -0,0 +1,2 @@
+/incubator/cassandra/branches/cassandra-0.6/interface/thrift/gen-py:911238-922688
+/incubator/cassandra/trunk/interface/thrift/gen-py:749219-907704

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/FailureDetector.java Mon Sep  6 20:56:06
2010
@@ -124,14 +124,16 @@ public class FailureDetector implements 
     
     public boolean isAlive(InetAddress ep)
     {
-       /* If the endpoint in question is the local endpoint return true. */
-        InetAddress localHost = FBUtilities.getLocalAddress();
-        if (localHost.equals(ep))
+        if (ep.equals(FBUtilities.getLocalAddress()))
             return true;
 
-    	/* Incoming port is assumed to be the Storage port. We need to change it to the control
port */
         EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep);
-        return epState.isAlive();
+        // we could assert not-null, but having isAlive fail screws a node over so badly
that
+        // it's worth being defensive here so minor bugs don't cause disproportionate
+        // badness.  (See CASSANDRA-1463 for an example).
+        if (epState == null)
+            logger_.error("unknown endpoint " + ep);
+        return epState != null && epState.isAlive();
     }
     
     public void report(InetAddress ep)

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Mon Sep  6 20:56:06 2010
@@ -231,6 +231,10 @@ public class Gossiper implements IFailur
      */
     public void removeEndpoint(InetAddress endpoint)
     {
+        // do subscribers first so anything in the subscriber that depends on gossiper state
won't get confused
+        for (IEndpointStateChangeSubscriber subscriber : subscribers_)
+            subscriber.onRemove(endpoint);
+
         liveEndpoints_.remove(endpoint);
         unreachableEndpoints_.remove(endpoint);
         endpointStateMap_.remove(endpoint);

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/IEndpointStateChangeSubscriber.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/IEndpointStateChangeSubscriber.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/IEndpointStateChangeSubscriber.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/IEndpointStateChangeSubscriber.java
Mon Sep  6 20:56:06 2010
@@ -45,4 +45,6 @@ public interface IEndpointStateChangeSub
     public void onAlive(InetAddress endpoint, EndpointState state);
 
     public void onDead(InetAddress endpoint, EndpointState state);
+
+    public void onRemove(InetAddress endpoint);
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/TokenMetadata.java Mon Sep  6 20:56:06
2010
@@ -185,27 +185,13 @@ public class TokenMetadata
         }
     }
 
-    public void removeLeavingEndpoint(InetAddress endpoint)
+    public void removeEndpoint(InetAddress endpoint)
     {
         assert endpoint != null;
 
         lock.writeLock().lock();
         try
         {
-            leavingEndpoints.remove(endpoint);
-        }
-        finally
-        {
-            lock.writeLock().unlock();
-        }
-    }
-
-    public void removeEndpoint(InetAddress endpoint)
-    {
-        assert tokenToEndpointMap.containsValue(endpoint);
-        lock.writeLock().lock();
-        try
-        {
             bootstrapTokens.inverse().remove(endpoint);
             tokenToEndpointMap.inverse().remove(endpoint);
             leavingEndpoints.remove(endpoint);

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java Mon Sep 
6 20:56:06 2010
@@ -42,16 +42,14 @@ public class OutboundTcpConnection exten
     private static final ByteBuffer CLOSE_SENTINEL = ByteBuffer.allocate(0);
     private static final int OPEN_RETRY_DELAY = 100; // ms between retries
 
-    private final OutboundTcpConnectionPool pool;
     private final InetAddress endpoint;
     private final BlockingQueue<ByteBuffer> queue = new LinkedBlockingQueue<ByteBuffer>();
     private DataOutputStream output;
     private Socket socket;
 
-    public OutboundTcpConnection(final OutboundTcpConnectionPool pool, final InetAddress
remoteEp)
+    public OutboundTcpConnection(InetAddress remoteEp)
     {
         super("WRITE-" + remoteEp);
-        this.pool = pool;
         this.endpoint = remoteEp;
     }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java Mon Sep
 6 20:56:06 2010
@@ -18,53 +18,35 @@
 
 package org.apache.cassandra.net;
 
-import java.io.IOException;
 import java.net.InetAddress;
 
 import org.apache.cassandra.concurrent.StageManager;
 
 class OutboundTcpConnectionPool
 {
-    private InetAddress remoteEp_;
-    private OutboundTcpConnection cmdCon;
-    private OutboundTcpConnection ackCon;
+    private final OutboundTcpConnection cmdCon;
+    private final OutboundTcpConnection ackCon;
 
     OutboundTcpConnectionPool(InetAddress remoteEp)
     {
-        remoteEp_ = remoteEp;
+         cmdCon = new OutboundTcpConnection(remoteEp);
+         ackCon = new OutboundTcpConnection(remoteEp);                                  
          
     }
 
     /**
      * returns the appropriate connection based on message type.
      * returns null if a connection could not be established.
      */
-    synchronized OutboundTcpConnection getConnection(Message msg)
+    OutboundTcpConnection getConnection(Message msg)
     {
-        if (StageManager.RESPONSE_STAGE.equals(msg.getMessageType())
-            || StageManager.GOSSIP_STAGE.equals(msg.getMessageType()))
-        {
-            if (ackCon == null)
-            {
-                ackCon = new OutboundTcpConnection(this, remoteEp_);
-                ackCon.start();
-            }
-            return ackCon;
-        }
-        else
-        {
-            if (cmdCon == null)
-            {
-                cmdCon = new OutboundTcpConnection(this, remoteEp_);
-                cmdCon.start();
-            }
-            return cmdCon;
-        }
+        return msg.getMessageType().equals(StageManager.RESPONSE_STAGE) || msg.getMessageType().equals(StageManager.GOSSIP_STAGE)
+               ? ackCon
+               : cmdCon;
     }
 
     synchronized void reset()
     {
         for (OutboundTcpConnection con : new OutboundTcpConnection[] { cmdCon, ackCon })
-            if (con != null)
-                con.closeSocket();
+            con.closeSocket();
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/MigrationManager.java Mon Sep  6
20:56:06 2010
@@ -77,6 +77,8 @@ public class MigrationManager implements
     }
 
     public void onDead(InetAddress endpoint, EndpointState state) { }
+
+    public void onRemove(InetAddress endpoint) { }
     
     /** will either push or pull an updating depending on who is behind. */
     public static void rectify(UUID theirVersion, InetAddress endpoint)

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java Mon Sep
 6 20:56:06 2010
@@ -224,6 +224,8 @@ public class StorageLoadBalancer impleme
 
     public void onDead(InetAddress endpoint, EndpointState state) {}
 
+    public void onRemove(InetAddress endpoint) {}
+
 /*
     private boolean isMoveable()
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=993151&r1=993150&r2=993151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon Sep  6 20:56:06
2010
@@ -745,7 +745,7 @@ public class StorageService implements I
     {
         restoreReplicaCount(endpoint);
         Gossiper.instance.removeEndpoint(endpoint);
-        tokenMetadata_.removeEndpoint(endpoint);
+        // gossiper onRemove will take care of TokenMetadata
         HintedHandOffManager.deleteHintsForEndPoint(endpoint);
     }
 
@@ -963,7 +963,13 @@ public class StorageService implements I
             deliverHints(endpoint);
     }
 
-    public void onDead(InetAddress endpoint, EndpointState state) 
+    public void onRemove(InetAddress endpoint)
+    {
+        tokenMetadata_.removeEndpoint(endpoint);
+        calculatePendingRanges();
+    }
+
+    public void onDead(InetAddress endpoint, EndpointState state)
     {
         MessagingService.instance.convict(endpoint);
     }



Mime
View raw message