Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Normal
Description
Hello,
It seems that there is a bug in calculating QUORUM in src/java/org/apache/cassandra/service/QuorumResponseHandler.java
Currently the QUORUM formula in place will return correct QUORUM if replication factor <= 3. However if you have a Replication Factor > 3, it will return incorrect result.
-----------------------
— src/java/org/apache/cassandra/service/QuorumResponseHandler.java (revision 995482)
+++ src/java/org/apache/cassandra/service/QuorumResponseHandler.java (working copy)
@@ -109,7 +109,7 @@
case ANY:
return 1;
case QUORUM:
- return (DatabaseDescriptor.getQuorum(table)/ 2) + 1;
+ return DatabaseDescriptor.getQuorum(table);
case ALL:
return DatabaseDescriptor.getReplicationFactor(table);
default:
-------------------
In QuorumResponseHandler:determineBlockFor()
DatabaseDescriptor.getQuorum(table) is already returning a quorum value which is further divided by 2 and a one is added.
So say if your RF=6, it is suppose to check 4 replicas, (6/2)+1=4 but it ends up checking only 3 replicas as DatabaseDescriptor.getQuorum returns 4, so determineBlockFor will return (4/2)+1=3.
Let me know if you have any questions.
Jignesh