<h3 dir="auto">Affected Version</h3>
<p dir="auto">0.14.0-rc1</p>
<h3 dir="auto">Description</h3>
<p dir="auto">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 <a href="https://github.com/apache/incubator-druid/blob/master/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java#L2347">this line</a>. Maybe <code class="notranslate">isExclusive</code> should be set to true. But, I'm not sure why it happened for only one dataSource.</p>
<p dir="auto">BufferUnderflowExceptions reported with 0.9.2-rc1: <a href="https://groups.google.com/d/topic/druid-user/bZJq0Z3U_Ms/discussion" rel="nofollow">https://groups.google.com/d/topic/druid-user/bZJq0Z3U_Ms/discussion</a>. May be related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="169025566" data-permission-text="Title is private" data-url="https://github.com/apache/druid/issues/3314" data-hovercard-type="pull_request" data-hovercard-url="/apache/druid/pull/3314/hovercard" href="https://github.com/apache/druid/pull/3314">#3314</a>.</p>
<p dir="auto">The stack trace was:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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]"><pre class="notranslate"><code class="notranslate">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]
</code></pre></div>