You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2021/06/24 01:13:51 UTC

[iotdb] branch nextChunkBug created (now c60b8d8)

This is an automated email from the ASF dual-hosted git repository.

xiangweiwei pushed a change to branch nextChunkBug
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at c60b8d8  fix hasNextChunk bug

This branch includes the following new commits:

     new c60b8d8  fix hasNextChunk bug

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: fix hasNextChunk bug

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiangweiwei pushed a commit to branch nextChunkBug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c60b8d811fba2efa3a9b04707a18e900f9d54242
Author: Alima777 <wx...@gmail.com>
AuthorDate: Thu Jun 24 09:13:15 2021 +0800

    fix hasNextChunk bug
---
 .../java/org/apache/iotdb/db/query/reader/series/SeriesReader.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java b/server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java
index 7c1213f..b225a0f 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/reader/series/SeriesReader.java
@@ -320,13 +320,16 @@ public class SeriesReader {
       /*
        * first time series metadata is already unpacked, consume cached ChunkMetadata
        */
-      if (!cachedChunkMetadata.isEmpty()) {
+      while (!cachedChunkMetadata.isEmpty()) {
         firstChunkMetadata = cachedChunkMetadata.peek();
         unpackAllOverlappedTsFilesToTimeSeriesMetadata(
             orderUtils.getOverlapCheckTime(firstChunkMetadata.getStatistics()));
         unpackAllOverlappedTimeSeriesMetadataToCachedChunkMetadata(
             orderUtils.getOverlapCheckTime(firstChunkMetadata.getStatistics()), false);
-        firstChunkMetadata = cachedChunkMetadata.poll();
+        if (firstChunkMetadata.equals(cachedChunkMetadata.peek())) {
+          firstChunkMetadata = cachedChunkMetadata.poll();
+          break;
+        }
       }
     }