cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Dynamic Snitch Problem
Date Tue, 17 May 2011 15:01:43 GMT
I guess otherwise it NPEs?

Looks like a bug, can you open a ticket?

On Tue, May 17, 2011 at 4:19 AM, Daniel Doubleday
<daniel.doubleday@gmx.net> wrote:
> Hi all
>
> after upgrading to 0.7 we have a small problem with dynamic snitch:
>
> we have rf=3, quorum read/write and read repair prop set to 0. Thus cassandra always
shortcuts reads to only 2 hosts.
>
> Problem is that one of our nodes get ignored unless using a little patch and initialize
the scores.
>
> Anybody else sees this?
>
> Cheers,
> Daniel
>
> btw: we had to do this on 0.6 too when using the 'shortcut' read path.
>
> Index: src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
> ===================================================================
> --- src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java    (revision 1100429)
> +++ src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java    (revision )
> @@ -178,8 +178,16 @@
>     {
>         Double scored1 = scores.get(a1);
>         Double scored2 = scores.get(a2);
> -
> +
> -        if (scored1 == null || scored2 == null || scored1.equals(scored2))
> +        if (scored1 == null) {
> +            scored1 = 0.0;
> +        }
> +
> +        if (scored2 == null) {
> +            scored2 = 0.0;
> +        }
> +
> +        if (scored1.equals(scored2))
>             return subsnitch.compareEndpoints(target, a1, a2);
>         if (scored1 < scored2)
>             return -1;
>
>
>
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Mime
View raw message