You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/01/22 11:27:46 UTC

[iotdb] branch MergeBug created (now 8db0647)

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

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


      at 8db0647  fix merge bug

This branch includes the following new commits:

     new 8db0647  fix merge 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 merge bug

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

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

commit 8db064795e3979defb7ac155ff4c77edff1f0d45
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Fri Jan 22 19:27:15 2021 +0800

    fix merge bug
---
 .../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();