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

[iotdb] branch master updated: Fix merge bug that page statistics incorrectly use the chunk statistics for new Tsfile Format (#2561)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 88adb37  Fix merge bug that page statistics incorrectly use the chunk statistics for new Tsfile Format (#2561)
88adb37 is described below

commit 88adb37ea741f899fac05bb5d60f361a16f77f41
Author: Jackie Tien <Ja...@foxmail.com>
AuthorDate: Sat Jan 23 14:01:55 2021 +0800

    Fix merge bug that page statistics incorrectly use the chunk statistics for new Tsfile Format (#2561)
---
 .../org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java | 2 +-
 .../org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
index 2469f5e..e3c2081 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
@@ -85,8 +85,8 @@ public class CompactionUtils {
           newChunkMetadata = chunkMetadata;
           newChunk = chunk;
         } else {
-          newChunkMetadata.mergeChunkMetadata(chunkMetadata);
           newChunk.mergeChunk(chunk);
+          newChunkMetadata.mergeChunkMetadata(chunkMetadata);
         }
       }
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
index e2ebf0b..95d3ac6 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
@@ -624,6 +624,11 @@ public class IoTDBNewTsFileCompactionIT {
         }
       }
       assertEquals(retArray.length, cnt);
+
+      try (ResultSet resultSet = statement.executeQuery("SELECT count(s1) FROM root.sg1.d1 where time < 4")) {
+        assertTrue(resultSet.next());
+        assertEquals(3L, resultSet.getLong("count(root.sg1.d1.s1)"));
+      }
     } catch (StorageEngineException | InterruptedException e) {
       e.printStackTrace();
       fail();