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

rong pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new ac8526899f8 Pipe: Fix the problem that the Aligned information of the 
Tablet generated by TsFileInsertionEventScanParser is incorrect (#14136) 
(#14164)
ac8526899f8 is described below

commit ac8526899f8840f926b50be36c0491eb9aa90d4d
Author: Zhenyu Luo <[email protected]>
AuthorDate: Thu Nov 21 19:48:52 2024 +0800

    Pipe: Fix the problem that the Aligned information of the Tablet generated 
by TsFileInsertionEventScanParser is incorrect (#14136) (#14164)
---
 .../container/scan/TsFileInsertionScanDataContainer.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/container/scan/TsFileInsertionScanDataContainer.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/container/scan/TsFileInsertionScanDataContainer.java
index c6e5512ffa9..e73cca1cd9a 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/container/scan/TsFileInsertionScanDataContainer.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/container/scan/TsFileInsertionScanDataContainer.java
@@ -129,12 +129,17 @@ public class TsFileInsertionScanDataContainer extends 
TsFileInsertionDataContain
               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 PipeRawTabletInsertionEvent(
                   tablet,
-                  currentIsAligned,
+                  isAligned,
                   sourceEvent != null ? sourceEvent.getPipeName() : null,
                   sourceEvent != null ? sourceEvent.getCreationTime() : 0,
                   pipeTaskMeta,
@@ -164,10 +169,15 @@ public class TsFileInsertionScanDataContainer extends 
TsFileInsertionDataContain
               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