Issue 1:
Affected Version

0.14.0-rc1

Description

I created two dataSources for the same Kinesis stream, but it returned different results for the same query. Duplicate raw events was found in one dataSource (it was about 110 events). I'm suspecting this line. Maybe isExclusive should be set to true. But, I'm not sure why it happened for only one dataSource.

Issue 2:
BufferUnderflowExceptions reported with 0.9.2-rc1: https://groups.google.com/d/topic/druid-user/bZJq0Z3U_Ms/discussion. May be related to #3314.

The stack trace was:

016-10-03T17:20:43,407 ERROR [processing-9] io.druid.query.GroupByMergedQueryRunner - Exception with one of the sequences!
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:506) ~[?:1.8.0_101]
at java.nio.DirectByteBuffer.getShort(DirectByteBuffer.java:590) ~[?:1.8.0_101]
at io.druid.query.aggregation.hyperloglog.HyperLogLogCollector.fold(HyperLogLogCollector.java:393) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.aggregation.hyperloglog.HyperUniquesBufferAggregator.aggregate(HyperUniquesBufferAggregator.java:65) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:237) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.updateValues(GroupByQueryEngine.java:200) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowUpdater.access$100(GroupByQueryEngine.java:150) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowIterator.next(GroupByQueryEngine.java:378) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.groupby.GroupByQueryEngine$RowIterator.next(GroupByQueryEngine.java:293) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at com.metamx.common.guava.BaseSequence.accumulate(BaseSequence.java:67) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ConcatSequence$1.accumulate(ConcatSequence.java:46) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ConcatSequence$1.accumulate(ConcatSequence.java:42) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.MappingAccumulator.accumulate(MappingAccumulator.java:39) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.FilteringAccumulator.accumulate(FilteringAccumulator.java:40) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.MappingAccumulator.accumulate(MappingAccumulator.java:39) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.BaseSequence.accumulate(BaseSequence.java:67) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.MappedSequence.accumulate(MappedSequence.java:40) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ResourceClosingSequence.accumulate(ResourceClosingSequence.java:38) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.FilteredSequence.accumulate(FilteredSequence.java:42) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.MappedSequence.accumulate(MappedSequence.java:40) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ResourceClosingSequence.accumulate(ResourceClosingSequence.java:38) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ConcatSequence.accumulate(ConcatSequence.java:40) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.ResourceClosingSequence.accumulate(ResourceClosingSequence.java:38) ~[java-util-0.27.10.jar:?]
at io.druid.query.MetricsEmittingQueryRunner$1.accumulate(MetricsEmittingQueryRunner.java:104) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at com.metamx.common.guava.MappedSequence.accumulate(MappedSequence.java:40) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.Sequences$1.accumulate(Sequences.java:90) ~[java-util-0.27.10.jar:?]
at com.metamx.common.guava.Sequences.toList(Sequences.java:113) ~[java-util-0.27.10.jar:?]
at io.druid.query.BySegmentQueryRunner.run(BySegmentQueryRunner.java:56) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.MetricsEmittingQueryRunner$1.accumulate(MetricsEmittingQueryRunner.java:104) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.spec.SpecificSegmentQueryRunner$2$1.call(SpecificSegmentQueryRunner.java:87) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:171) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.spec.SpecificSegmentQueryRunner.access$400(SpecificSegmentQueryRunner.java:41) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.spec.SpecificSegmentQueryRunner$2.doItNamed(SpecificSegmentQueryRunner.java:162) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.spec.SpecificSegmentQueryRunner$2.accumulate(SpecificSegmentQueryRunner.java:80) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.CPUTimeMetricQueryRunner$1.accumulate(CPUTimeMetricQueryRunner.java:81) ~[druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at com.metamx.common.guava.Sequences$1.accumulate(Sequences.java:90) ~[java-util-0.27.10.jar:?]
at io.druid.query.GroupByMergedQueryRunner$1$1.call(GroupByMergedQueryRunner.java:118) [druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at io.druid.query.GroupByMergedQueryRunner$1$1.call(GroupByMergedQueryRunner.java:111) [druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_101]
at io.druid.query.PrioritizedListenableFutureTask.run(PrioritizedExecutorService.java:271) [druid-processing-0.9.2-rc1.jar:0.9.2-rc1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]