Fix availability validation for LOCAL_ONE CL

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-7319
This commit is contained in:
Aleksey Yeschenko 2014-05-29 19:01:32 +03:00
parent 7bbeb5aa2d
commit ea26dbd730
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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)