cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1036886 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/avro/CassandraServer.java src/java/org/apache/cassandra/service/StorageProxy.java
Date Fri, 19 Nov 2010 15:16:36 GMT
Author: jbellis
Date: Fri Nov 19 15:16:35 2010
New Revision: 1036886

URL: http://svn.apache.org/viewvc?rev=1036886&view=rev
Log:
handle replica unavailability in index scan
patch by tjake; reviewed by jbellis for CASSANDRA-1755

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1036886&r1=1036885&r2=1036886&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Fri Nov 19 15:16:35 2010
@@ -40,6 +40,7 @@ dev
  * retain reference to PendingFile sstables (CASSANDRA-1749)
  * fix sstableimport regression (CASSANDRA-1753)
  * fix for bootstrap when no non-system tables are defined (CASSANDRA-1732)
+ * handle replica unavailability in index scan (CASSANDRA-1755)
 
 
 0.7.0-beta3

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=1036886&r1=1036885&r2=1036886&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/avro/CassandraServer.java
Fri Nov 19 15:16:35 2010
@@ -1100,6 +1100,10 @@ public class CassandraServer implements 
         {
             throw new TimedOutException();
         }
+        catch (org.apache.cassandra.thrift.UnavailableException e)
+        {
+            throw newUnavailableException();
+        }
         return avronateKeySlices(rows, column_parent, column_predicate);
     }
 

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1036886&r1=1036885&r2=1036886&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
Fri Nov 19 15:16:35 2010
@@ -647,7 +647,7 @@ public class StorageProxy implements Sto
     }
 
     public static List<Row> scan(String keyspace, String column_family, IndexClause
index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level)
-    throws IOException, TimeoutException
+    throws IOException, TimeoutException, UnavailableException
     {
         IPartitioner p = StorageService.getPartitioner();
 
@@ -666,7 +666,11 @@ public class StorageProxy implements Sto
             RangeSliceResponseResolver resolver = new RangeSliceResponseResolver(keyspace,
liveEndpoints);
             AbstractReplicationStrategy rs = Table.open(keyspace).replicationStrategy;
             QuorumResponseHandler<List<Row>> handler = rs.getQuorumResponseHandler(resolver,
consistency_level);
-            // TODO bail early if live endpoints can't satisfy requested consistency level
+            
+            // bail early if live endpoints can't satisfy requested consistency level
+            if(handler.blockfor > liveEndpoints.size())
+                throw new UnavailableException();
+            
             IndexScanCommand command = new IndexScanCommand(keyspace, column_family, index_clause,
column_predicate, range);
             Message message = command.getMessage();
             for (InetAddress endpoint : liveEndpoints)



Mime
View raw message