cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [6/9] git commit: Fix race processing range scan responses patch by jbellis; reviewed by mstepura and ayeschenko for CASSANDRA-6820
Date Sat, 22 Mar 2014 02:52:20 GMT
Fix race processing range scan responses
patch by jbellis; reviewed by mstepura and ayeschenko for CASSANDRA-6820


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

Branch: refs/heads/trunk
Commit: 4347982974176bd20bfa69d72a72f895e1b05d25
Parents: e682c03
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Mar 21 21:45:09 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Mar 21 21:49:28 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/service/ReadCallback.java | 2 ++
 src/java/org/apache/cassandra/service/StorageProxy.java | 3 ++-
 3 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/43479829/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c89ae51..64dc248 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.7
+ * Fix race processing range scan responses (CASSANDRA-6820)
  * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821)
  * Add uuid() function (CASSANDRA-6473)
  * Omit tombstones from schema digests (CASSANDRA-6862)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/43479829/src/java/org/apache/cassandra/service/ReadCallback.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ReadCallback.java b/src/java/org/apache/cassandra/service/ReadCallback.java
index 085787c..150fabe 100644
--- a/src/java/org/apache/cassandra/service/ReadCallback.java
+++ b/src/java/org/apache/cassandra/service/ReadCallback.java
@@ -76,6 +76,8 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         this.resolver = resolver;
         this.start = System.nanoTime();
         this.endpoints = endpoints;
+        // we don't support read repair (or rapid read protection) for range scans yet (CASSANDRA-6897)
+        assert !(resolver instanceof RangeSliceResponseResolver) || blockfor >= endpoints.size();
     }
 
     public boolean await(long timePastStart, TimeUnit unit)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/43479829/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index a6912c2..12f9ece 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -1473,7 +1473,8 @@ public class StorageProxy implements StorageProxyMBean
 
                 // collect replies and resolve according to consistency level
                 RangeSliceResponseResolver resolver = new RangeSliceResponseResolver(nodeCmd.keyspace,
command.timestamp);
-                ReadCallback<RangeSliceReply, Iterable<Row>> handler = new ReadCallback(resolver,
consistency_level, nodeCmd, filteredEndpoints);
+                List<InetAddress> minimalEndpoints = filteredEndpoints.subList(0, Math.min(filteredEndpoints.size(),
consistency_level.blockFor(keyspace)));
+                ReadCallback<RangeSliceReply, Iterable<Row>> handler = new ReadCallback<>(resolver,
consistency_level, nodeCmd, minimalEndpoints);
                 handler.assureSufficientLiveNodes();
                 resolver.setSources(filteredEndpoints);
                 if (filteredEndpoints.size() == 1


Mime
View raw message