Skip to content

Commit f68c49e

Browse files
authored
Pipe: Fixed the bug that lower version tablet may cause NPE when sent to 2.x version & The temporary exception may be wrongly reported (#16843)
* older_version_compatibility * protect * dependency
1 parent 8cd1418 commit f68c49e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/processor/PipeProcessorSubtask.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.apache.iotdb.pipe.api.exception.PipeException;
4646

4747
import com.google.common.util.concurrent.ListeningExecutorService;
48+
import org.apache.tsfile.external.commons.lang3.exception.ExceptionUtils;
4849
import org.slf4j.Logger;
4950
import org.slf4j.LoggerFactory;
5051

@@ -219,6 +220,12 @@ protected boolean executeOnce() throws Exception {
219220
e);
220221
return false;
221222
} catch (final Exception e) {
223+
if (ExceptionUtils.getRootCause(e) instanceof PipeRuntimeOutOfMemoryCriticalException) {
224+
LOGGER.info(
225+
"Temporarily out of memory in pipe event processing, will wait for the memory to release.",
226+
e);
227+
return false;
228+
}
222229
if (!isClosed.get()) {
223230
throw new PipeException(
224231
String.format(

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public void throwIfNoPrivilege() {
468468
}
469469
}
470470
}
471-
} catch (final AccessDeniedException e) {
471+
} catch (final AccessDeniedException | PipeRuntimeOutOfMemoryCriticalException e) {
472472
throw e;
473473
} catch (final Exception e) {
474474
if (e instanceof InterruptedException) {

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/util/sorter/PipeTabletEventSorter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.apache.tsfile.write.schema.IMeasurementSchema;
2828

2929
import java.time.LocalDate;
30+
import java.util.Objects;
3031

3132
public class PipeTabletEventSorter {
3233

@@ -84,6 +85,10 @@ protected Object reorderValueListAndBitMap(
8485
final TSDataType dataType,
8586
final BitMap originalBitMap,
8687
final BitMap deDuplicatedBitMap) {
88+
// Older version's sender may contain null values, we need to cover this case
89+
if (Objects.isNull(valueList)) {
90+
return null;
91+
}
8792
switch (dataType) {
8893
case BOOLEAN:
8994
final boolean[] boolValues = (boolean[]) valueList;

0 commit comments

Comments
 (0)