cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Doubleday <daniel.double...@gmx.net>
Subject Dynamic Snitch Problem
Date Tue, 17 May 2011 09:19:58 GMT
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;






Mime
View raw message