Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1ABDC10A8E for ; Tue, 11 Feb 2014 20:08:36 +0000 (UTC) Received: (qmail 74663 invoked by uid 500); 11 Feb 2014 20:08:32 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 74600 invoked by uid 500); 11 Feb 2014 20:08:29 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 74498 invoked by uid 99); 11 Feb 2014 20:08:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Feb 2014 20:08:26 +0000 Date: Tue, 11 Feb 2014 20:08:26 +0000 (UTC) From: "Aleksey Yeschenko (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-6683) BADNESS_THRESHOLD does not working correctly with DynamicEndpointSnitch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Yeschenko updated CASSANDRA-6683: ----------------------------------------- Fix Version/s: (was: 2.0.5) 2.0.6 > 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)