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 a9ba7243ba9 Pipe: Fixed the NPE of commit interval (#16714)
a9ba7243ba9 is described below
commit a9ba7243ba9667ff0e88d32e067299ecba519f19
Author: Caideyipi <[email protected]>
AuthorDate: Mon Nov 10 09:42:10 2025 +0800
Pipe: Fixed the NPE of commit interval (#16714)
* fix
* fix
---
.../commons/pipe/agent/task/progress/interval/PipeCommitInterval.java | 4 +++-
.../apache/iotdb/commons/pipe/datastructure/PipeCommitQueueTest.java | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
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 46a3d3e2a86..885df4727da 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
@@ -20,6 +20,7 @@
package org.apache.iotdb.commons.pipe.agent.task.progress.interval;
import org.apache.iotdb.commons.consensus.index.ProgressIndex;
+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;
@@ -40,7 +41,8 @@ public class PipeCommitInterval extends
Interval<PipeCommitInterval> {
final PipeTaskMeta pipeTaskMeta) {
super(start, end);
this.pipeTaskMeta = pipeTaskMeta;
- this.currentIndex = currentIndex;
+ this.currentIndex =
+ Objects.nonNull(currentIndex) ? currentIndex :
MinimumProgressIndex.INSTANCE;
this.onCommittedHooks = onCommittedHooks;
}
diff --git
a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/datastructure/PipeCommitQueueTest.java
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/datastructure/PipeCommitQueueTest.java
index 61b217c35d4..6a894b21041 100644
---
a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/datastructure/PipeCommitQueueTest.java
+++
b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/datastructure/PipeCommitQueueTest.java
@@ -57,6 +57,8 @@ public class PipeCommitQueueTest {
Assert.assertEquals(0, pipeCommitQueue.size());
Assert.assertEquals(new IoTProgressIndex(0, 4L),
pipeTaskMeta.getProgressIndex());
Assert.assertEquals(1, commitHookTestSet.size());
+ // Test null progressIndex
+ pipeCommitQueue.offer(new TestEnrichedEvent(6, null));
}
private class TestEnrichedEvent extends EnrichedEvent {