You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (JIRA)" <ji...@apache.org> on 2014/02/12 15:13:19 UTC

[jira] [Comment Edited] (CASSANDRA-6683) BADNESS_THRESHOLD does not working correctly with DynamicEndpointSnitch

    [ https://issues.apache.org/jira/browse/CASSANDRA-6683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13899130#comment-13899130 ] 

Brandon Williams edited comment on CASSANDRA-6683 at 2/12/14 2:12 PM:
----------------------------------------------------------------------

You could test by disabling the dynamic snitch with {noformat}dynamic_snitch: false{noformat} so the sorting is always the same.


was (Author: brandon.williams):
You could test by disabling the dynamic snitch with {{noformat}}dynamic_snitch: false{{noformat}} so the sorting is always the same.

> BADNESS_THRESHOLD does not working correctly with DynamicEndpointSnitch
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-6683
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6683
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux 3.8.0-33-generic
>            Reporter: Kirill Bogdanov
>              Labels: snitch
>             Fix For: 2.0.6
>
>
> There is a problem in *DynamicEndpointSnitch.java* in sortByProximityWithBadness()
> Before calling sortByProximityWithScore we comparing each nodes score ratios to the badness threshold.
> {code}
> if ((first - next) / first >  BADNESS_THRESHOLD)
>             {
>                 sortByProximityWithScore(address, addresses);
>                 return;
>             }
> {code}
> This is not always the correct comparison because *first* score can be less than *next*  score and in that case we will compare a negative number with positive.
> The solution is to compute absolute value of the ratio:
> {code}
> if (Math.abs((first - next) / first) > BADNESS_THRESHOLD)
> {code}
> This issue causing an incorrect sorting of DCs based on their performance and affects performance of the snitch.
> Thanks.
>  



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)