You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Anthony Cozzie (JIRA)" <ji...@apache.org> on 2015/01/17 01:29:35 UTC
[jira] [Updated] (CASSANDRA-8640) Paxos requires all nodes for CAS
[ https://issues.apache.org/jira/browse/CASSANDRA-8640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anthony Cozzie updated CASSANDRA-8640:
--------------------------------------
Description:
{code}
int requiredParticipants = participants + 1 / 2; // See CASSANDRA-833
{code}
Will always return participants because of operator precedence. I am not sure just adding parentheses will fix the problem, though, as the original code differentiated between pending and natural endpoints.
{code}
int requiredParticipants = pendingEndpoints.size() + 1 + naturalEndpoints.size() / 2; // See CASSANDRA-833
{code}
was:
{code}
int requiredParticipants = participants + 1 / 2; // See CASSANDRA-833
{code}
Fails owing to the order of operations. I am not sure just adding parentheses will fix the problem, though, as the original code differentiated between pending and natural endpoints.
{code}
int requiredParticipants = pendingEndpoints.size() + 1 + naturalEndpoints.size() / 2; // See CASSANDRA-833
{code}
> Paxos requires all nodes for CAS
> --------------------------------
>
> Key: CASSANDRA-8640
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8640
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Reporter: Anthony Cozzie
> Assignee: Sylvain Lebresne
>
> {code}
> int requiredParticipants = participants + 1 / 2; // See CASSANDRA-833
> {code}
> Will always return participants because of operator precedence. I am not sure just adding parentheses will fix the problem, though, as the original code differentiated between pending and natural endpoints.
> {code}
> int requiredParticipants = pendingEndpoints.size() + 1 + naturalEndpoints.size() / 2; // See CASSANDRA-833
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)