Repository: cassandra Updated Branches: refs/heads/trunk 30a5597ca -> 4937451f5
Fixup for #8558 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e16d76dc Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e16d76dc Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e16d76dc Branch: refs/heads/trunk Commit: e16d76dc84022a37dc544183732bfe9e9fb3fd94 Parents: 92f7539 Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Wed Jan 14 18:15:13 2015 +0100 Committer: Sylvain Lebresne <sylv...@datastax.com> Committed: Wed Jan 14 18:15:13 2015 +0100 ---------------------------------------------------------------------- .../db/columniterator/IndexedSliceReader.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e16d76dc/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java index 4409484..2216725 100644 --- a/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java +++ b/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java @@ -337,7 +337,7 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskA boolean inSlice = false; OnDiskAtom prefetchedCol; - while ((prefetchedCol = prefetched.peek() ) != null) + while ((prefetchedCol = prefetched.peek()) != null) { // col is before slice, we update the slice if (isColumnBeforeSliceStart(prefetchedCol)) @@ -351,12 +351,15 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskA continue; } - // Otherwise, we either move to the next slice or, if we have none (which can happen - // because we unwind prefetched no matter what due to RT), we skip the cell - if (hasMoreSlice()) - setNextSlice(); - else - prefetched.poll(); + // Otherwise, we either move to the next slice. If we have no more slice, then + // simply unwind prefetched entirely and add all RT. + if (!setNextSlice()) + { + while ((prefetchedCol = prefetched.poll()) != null) + if (prefetchedCol instanceof RangeTombstone) + blockColumns.addLast(prefetchedCol); + break; + } } // col is within slice, all columns @@ -373,8 +376,11 @@ class IndexedSliceReader extends AbstractIterator<OnDiskAtom> implements OnDiskA prefetched.poll(); } } + if (!blockColumns.isEmpty()) return true; + else if (!hasMoreSlice()) + return false; } try {