[ 
https://issues.apache.org/jira/browse/CASSANDRA-1487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jignesh Dhruv updated CASSANDRA-1487:
-------------------------------------

    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

  was:
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


> Bug in calculating QUORUM
> -------------------------
>
>                 Key: CASSANDRA-1487
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1487
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7 beta 1
>            Reporter: Jignesh Dhruv
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to