cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Slutsky (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (CASSANDRA-5209) For small datasets/single hadoop/single cassandra clusters, ColumnFamilyRecordReader throws InvalidRequestException(why:Start token sorts after end token)
Date Thu, 31 Jan 2013 21:09:12 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-5209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Anton Slutsky updated CASSANDRA-5209:
-------------------------------------

    Comment: was deleted

(was: diff --git a/src/java/org/apache/cassandra/dht/Range.java b/src/java/org/apache/cassandra/dht/Range.java
index 99286fe..402fe6c 100644
--- a/src/java/org/apache/cassandra/dht/Range.java
+++ b/src/java/org/apache/cassandra/dht/Range.java
@@ -229,12 +229,20 @@ public class Range<T extends RingPosition> extends AbstractBounds<T>
implements
 
     public List<Range<T>> unwrap()
     {
-        T minValue = (T) partitioner.minValue(right.getClass());
+	T minValue = (T) partitioner.minValue(right.getClass());
         if (!isWrapAround() || right.equals(minValue))
             return Arrays.asList(this);
+        
+        List<T> boundaries = new ArrayList<T>(3);
+        boundaries.add(minValue);
+        boundaries.add(left);
+        boundaries.add(right);
+        
+        Collections.<T>sort(boundaries);
+        
         List<Range<T>> unwrapped = new ArrayList<Range<T>>(2);
-        unwrapped.add(new Range<T>(left, minValue, partitioner));
-        unwrapped.add(new Range<T>(minValue, right, partitioner));
+        unwrapped.add(new Range<T>(boundaries.get(0), boundaries.get(1), partitioner));
+        unwrapped.add(new Range<T>(boundaries.get(1), boundaries.get(2), partitioner));
         return unwrapped;
     }
 )
    
> For small datasets/single hadoop/single cassandra clusters, ColumnFamilyRecordReader
throws InvalidRequestException(why:Start token sorts after end token)
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5209
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5209
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 1.2.1
>         Environment: Ubuntu 12.04
>            Reporter: Anton Slutsky
>             Fix For: 1.2.2
>
>
> When running the word count example, the following exception is thrown in most cases,
but not all the time.  I have debugged through and it appears that the reason is that Partitioner
implementations can get into a strange state producing splits with ranges with left value
being less than minValue.  This confuses org.apache.cassandra.dht.Range.unwrap() which returns
bogus ranges that start later than they finish.
> java.lang.RuntimeException: InvalidRequestException(why:Start token sorts after end token)
> 	at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$WideRowIterator.maybeInit(ColumnFamilyRecordReader.java:475)
> 	at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$WideRowIterator.computeNext(ColumnFamilyRecordReader.java:481)
> 	at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$WideRowIterator.computeNext(ColumnFamilyRecordReader.java:428)
> 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
> 	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
> 	at org.apache.cassandra.hadoop.ColumnFamilyRecordReader.nextKeyValue(ColumnFamilyRecordReader.java:199)
> 	at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:532)
> 	at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
> 	at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
> 	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
> 	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
> 	at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:212)
> Caused by: InvalidRequestException(why:Start token sorts after end token)
> 	at org.apache.cassandra.thrift.Cassandra$get_paged_slice_result.read(Cassandra.java:14168)
> 	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
> 	at org.apache.cassandra.thrift.Cassandra$Client.recv_get_paged_slice(Cassandra.java:769)
> 	at org.apache.cassandra.thrift.Cassandra$Client.get_paged_slice(Cassandra.java:753)
> 	at org.apache.cassandra.hadoop.ColumnFamilyRecordReader$WideRowIterator.maybeInit(ColumnFamilyRecordReader.java:460)
> 	... 11 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message