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

rong 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 4edc42b97f8 Pipe: Fix the problem that the Aligned information of the 
Tablet generated by TsFileInsertionEventScanParser is incorrect (#14136)
4edc42b97f8 is described below

commit 4edc42b97f8f908380dd5e280f97267511773f1a
Author: Zhenyu Luo <luoluoyuyu2...@gmail.com>
AuthorDate: Thu Nov 21 17:35:04 2024 +0800

    Pipe: Fix the problem that the Aligned information of the Tablet generated 
by TsFileInsertionEventScanParser is incorrect (#14136)
---
 .../tsfile/parser/scan/TsFileInsertionEventScanParser.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
index 45ded289dc9..39ec771167c 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/scan/TsFileInsertionEventScanParser.java
@@ -130,6 +130,11 @@ public class TsFileInsertionEventScanParser extends 
TsFileInsertionEventParser {
               throw new NoSuchElementException();
             }
 
+            // currentIsAligned is initialized when 
TsFileInsertionEventScanParser is constructed.
+            // When the getNextTablet function is called, currentIsAligned may 
be updated, causing
+            // the currentIsAligned information to be inconsistent with the 
current Tablet
+            // information.
+            final boolean isAligned = currentIsAligned;
             final Tablet tablet = getNextTablet();
             final boolean hasNext = hasNext();
             try {
@@ -137,7 +142,7 @@ public class TsFileInsertionEventScanParser extends 
TsFileInsertionEventParser {
                   sourceEvent != null ? sourceEvent.isTableModelEvent() : null,
                   sourceEvent != null ? sourceEvent.getTreeModelDatabaseName() 
: null,
                   tablet,
-                  currentIsAligned,
+                  isAligned,
                   sourceEvent != null ? sourceEvent.getPipeName() : null,
                   sourceEvent != null ? sourceEvent.getCreationTime() : 0,
                   pipeTaskMeta,
@@ -167,10 +172,15 @@ public class TsFileInsertionEventScanParser extends 
TsFileInsertionEventParser {
               throw new NoSuchElementException();
             }
 
+            // currentIsAligned is initialized when 
TsFileInsertionEventScanParser is constructed.
+            // When the getNextTablet function is called, currentIsAligned may 
be updated, causing
+            // the currentIsAligned information to be inconsistent with the 
current Tablet
+            // information.
+            final boolean isAligned = currentIsAligned;
             final Tablet tablet = getNextTablet();
             final boolean hasNext = hasNext();
             try {
-              return new Pair<>(tablet, currentIsAligned);
+              return new Pair<>(tablet, isAligned);
             } finally {
               if (!hasNext) {
                 close();

Reply via email to