This is an automated email from the ASF dual-hosted git repository.
jiangtian 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 6c8e1d5dd47 Pipe: Fixed the on committed hook square bug & Trimmed the
raw tablet hook & Fixed the premature report for source event & Skipped the
parsing of time-covered tsFile (#17360)
6c8e1d5dd47 is described below
commit 6c8e1d5dd47538faff847d4097fb42fd6daed9b1
Author: Caideyipi <[email protected]>
AuthorDate: Thu Mar 26 09:31:43 2026 +0800
Pipe: Fixed the on committed hook square bug & Trimmed the raw tablet hook
& Fixed the premature report for source event & Skipped the parsing of
time-covered tsFile (#17360)
* fix-data
* fix
---
.../common/tablet/PipeRawTabletInsertionEvent.java | 33 +++++++++++++++-------
.../common/tsfile/PipeTsFileInsertionEvent.java | 11 ++++++++
.../task/progress/interval/PipeCommitInterval.java | 3 +-
3 files changed, 36 insertions(+), 11 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
index c4f900b7d5f..7e85106af34 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/PipeRawTabletInsertionEvent.java
@@ -116,12 +116,14 @@ public class PipeRawTabletInsertionEvent extends
PipeInsertionEvent
this.allocatedMemoryBlock =
PipeDataNodeResourceManager.memory().forceAllocateForTabletWithRetry(0);
- addOnCommittedHook(
- () -> {
- if (shouldReportOnCommit) {
- eliminateProgressIndex();
- }
- });
+ if (needToReport) {
+ addOnCommittedHook(
+ () -> {
+ if (shouldReportOnCommit) {
+ eliminateProgressIndex();
+ }
+ });
+ }
}
public PipeRawTabletInsertionEvent(
@@ -303,10 +305,8 @@ public class PipeRawTabletInsertionEvent extends
PipeInsertionEvent
}
protected void eliminateProgressIndex() {
- if (needToReport) {
- if (sourceEvent instanceof PipeTsFileInsertionEvent) {
- ((PipeTsFileInsertionEvent) sourceEvent).eliminateProgressIndex();
- }
+ if (sourceEvent instanceof PipeTsFileInsertionEvent) {
+ ((PipeTsFileInsertionEvent) sourceEvent).eliminateProgressIndex();
}
}
@@ -387,6 +387,14 @@ public class PipeRawTabletInsertionEvent extends
PipeInsertionEvent
}
public void markAsNeedToReport() {
+ if (!needToReport) {
+ addOnCommittedHook(
+ () -> {
+ if (shouldReportOnCommit) {
+ eliminateProgressIndex();
+ }
+ });
+ }
this.needToReport = true;
}
@@ -404,6 +412,11 @@ public class PipeRawTabletInsertionEvent extends
PipeInsertionEvent
return sourceEvent;
}
+ @Override
+ public boolean isShouldReportOnCommit() {
+ return shouldReportOnCommit && needToReport;
+ }
+
/////////////////////////// TabletInsertionEvent ///////////////////////////
@Override
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java
index 316b728a278..1505e15996f 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java
@@ -561,6 +561,17 @@ public class PipeTsFileInsertionEvent extends
PipeInsertionEvent
|| startTime <= resource.getFileEndTime() &&
resource.getFileStartTime() <= endTime;
}
+ @Override
+ public boolean shouldParseTime() {
+ if (!isTimeParsed
+ && Objects.nonNull(resource)
+ && startTime <= resource.getFileStartTime()
+ && resource.getFileEndTime() <= endTime) {
+ isTimeParsed = true;
+ }
+ return !isTimeParsed;
+ }
+
@Override
public boolean mayEventPathsOverlappedWithPattern() {
if (Objects.isNull(resource) || !resource.isClosed() ||
isTableModelEvent()) {
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/progress/interval/PipeCommitInterval.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/progress/interval/PipeCommitInterval.java
index 885df4727da..456acd646dc 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/progress/interval/PipeCommitInterval.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/progress/interval/PipeCommitInterval.java
@@ -24,6 +24,7 @@ import
org.apache.iotdb.commons.consensus.index.impl.MinimumProgressIndex;
import org.apache.iotdb.commons.pipe.agent.task.meta.PipeTaskMeta;
import org.apache.iotdb.commons.pipe.datastructure.interval.Interval;
+import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -43,7 +44,7 @@ public class PipeCommitInterval extends
Interval<PipeCommitInterval> {
this.pipeTaskMeta = pipeTaskMeta;
this.currentIndex =
Objects.nonNull(currentIndex) ? currentIndex :
MinimumProgressIndex.INSTANCE;
- this.onCommittedHooks = onCommittedHooks;
+ this.onCommittedHooks = new ArrayList<>(onCommittedHooks);
}
@Override