cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: Fix availability validation for LOCAL_ONE CL
Date Thu, 29 May 2014 16:05:35 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 975145c27 -> 824ed37fc


Fix availability validation for LOCAL_ONE CL

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-7319


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

Branch: refs/heads/cassandra-2.0
Commit: ea26dbd730b0b340f65cdebd5ba9e899d367aa53
Parents: 7bbeb5a
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Thu May 29 19:01:32 2014 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Thu May 29 19:01:32 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                            | 1 +
 src/java/org/apache/cassandra/db/ConsistencyLevel.java | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ea26dbd7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 619c219..ba3a675 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -25,6 +25,7 @@
  * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
  * exit CQLSH with error status code if script fails (CASSANDRA-6344)
  * Fix bug with some IN queries missig results (CASSANDRA-7105)
+ * Fix availability validation for LOCAL_ONE CL (CASSANDRA-7319)
 
 
 1.2.16

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ea26dbd7/src/java/org/apache/cassandra/db/ConsistencyLevel.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ConsistencyLevel.java b/src/java/org/apache/cassandra/db/ConsistencyLevel.java
index 3737c73..e65b61f 100644
--- a/src/java/org/apache/cassandra/db/ConsistencyLevel.java
+++ b/src/java/org/apache/cassandra/db/ConsistencyLevel.java
@@ -249,6 +249,10 @@ public enum ConsistencyLevel
             case ANY:
                 // local hint is acceptable, and local node is always live
                 break;
+            case LOCAL_ONE:
+                if (countLocalEndpoints(liveEndpoints) == 0)
+                    throw new UnavailableException(this, 1, 0);
+                break;
             case LOCAL_QUORUM:
                 int localLive = countLocalEndpoints(liveEndpoints);
                 if (localLive < blockFor)


Mime
View raw message