cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [12/12] git commit: Fix LCS bug with sstables containing only 1 row
Date Mon, 23 Jul 2012 16:22:47 GMT
Fix LCS bug with sstables containing only 1 row

patch by slebresne; reviewed by jbellis for CASSANDRA-4411


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/02030dd6
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02030dd6
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02030dd6

Branch: refs/heads/trunk
Commit: 02030dd658e6ca0cdb8987fd72e0454066e1b6d6
Parents: 9f32efa
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Jul 16 15:34:33 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Jul 16 15:34:33 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                   |    1 +
 src/java/org/apache/cassandra/dht/Bounds.java |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02030dd6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f9b45d6..a3ba123 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,7 @@
  * (cql3) delete "component_index" column on DROP TABLE call (CASSANDRA-4420)
  * change nanoTime() to currentTimeInMillis() in schema related code (CASSANDRA-4432)
  * add a token generation tool (CASSANDRA-3709)
+ * Fix LCS bug with sstable containing only 1 row (CASSANDRA-4411)
 Merged from 1.0:
  * allow dropping columns shadowed by not-yet-expired supercolumn or row
    tombstones in PrecompactedRow (CASSANDRA-4396)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02030dd6/src/java/org/apache/cassandra/dht/Bounds.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/Bounds.java b/src/java/org/apache/cassandra/dht/Bounds.java
index 0e4dbdf..b5633c8 100644
--- a/src/java/org/apache/cassandra/dht/Bounds.java
+++ b/src/java/org/apache/cassandra/dht/Bounds.java
@@ -47,7 +47,10 @@ public class Bounds<T extends RingPosition> extends AbstractBounds<T>
 
     public boolean contains(T position)
     {
-        return Range.contains(left, right, position) || left.equals(position);
+        // Range.contains doesnt work correctly if left == right because for
+        // Range that means a wrapping range that select the whole ring. So we
+        // must explicitely handle this case
+        return left.equals(position) || (!left.equals(right) && Range.contains(left,
right, position));
     }
 
     public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position)


Mime
View raw message