From d4ed3002b3a72ca5e9017420f050c5f300735981 Mon Sep 17 00:00:00 2001 From: Caideyipi <87789683+Caideyipi@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:27:14 +0800 Subject: [PATCH 1/2] Pipe: Totally banned the receiver conversion (#16086) * logger * ci-fix * partial * Delete client-go * fix * rename * fix-ci --- .../manual/IoTDBPipeTypeConversionISessionIT.java | 5 ++++- ...ipeStatementDataTypeConvertExecutionVisitor.java | 4 +++- .../org/apache/iotdb/commons/conf/CommonConfig.java | 13 +++++++++++++ .../iotdb/commons/pipe/config/PipeConfig.java | 5 +++++ .../iotdb/commons/pipe/config/PipeDescriptor.java | 5 +++++ pom.xml | 1 + 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java index fc2b32e145bf1..c4198e1a9fe70 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/manual/IoTDBPipeTypeConversionISessionIT.java @@ -342,6 +342,8 @@ private void prepareTypeConversionTest( senderSession.executeNonQueryStatement("flush"); } else { // Send Tablet data to receiver + // Write once to create data regions, guarantee that no any tsFiles will be sent + consumer.accept(senderSession, receiverSession, tablet); createDataPipe(uuid, false); Thread.sleep(2000); // The actual implementation logic of inserting data @@ -390,12 +392,13 @@ private void createDataPipe(String diff, boolean isTSFile) { String sql = String.format( "create pipe test%s" - + " with source ('source'='iotdb-source','source.path'='root.test.**','realtime.mode'='%s','realtime.enable'='%s','history.enable'='true')" + + " with source ('source'='iotdb-source','source.path'='root.test.**','realtime.mode'='%s','realtime.enable'='%s','history.enable'='%s')" + " with processor ('processor'='do-nothing-processor')" + " with sink ('node-urls'='%s:%s','batch.enable'='false','sink.format'='%s')", diff, isTSFile ? "file" : "forced-log", !isTSFile, + isTSFile, receiverEnv.getIP(), receiverEnv.getPort(), isTSFile ? "tsfile" : "tablet"); diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementDataTypeConvertExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementDataTypeConvertExecutionVisitor.java index e795c5187cfe2..caa4a399f67fb 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementDataTypeConvertExecutionVisitor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementDataTypeConvertExecutionVisitor.java @@ -20,6 +20,7 @@ package org.apache.iotdb.db.pipe.receiver.visitor; import org.apache.iotdb.common.rpc.thrift.TSStatus; +import org.apache.iotdb.commons.pipe.config.PipeConfig; import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBPipePattern; import org.apache.iotdb.db.pipe.event.common.tsfile.container.scan.TsFileInsertionScanDataContainer; import org.apache.iotdb.db.pipe.receiver.protocol.thrift.IoTDBDataNodeReceiver; @@ -87,7 +88,8 @@ public Optional visitLoadFile( final LoadTsFileStatement loadTsFileStatement, final TSStatus status) { if (status.getCode() != TSStatusCode.LOAD_FILE_ERROR.getStatusCode() // Ignore the error if it is caused by insufficient memory - || (status.getMessage() != null && status.getMessage().contains("memory"))) { + || (status.getMessage() != null && status.getMessage().contains("memory")) + || !PipeConfig.getInstance().isPipeReceiverLoadConversionEnabled()) { return Optional.empty(); } diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java index f0e0bb52e46e7..117ee6c23a48d 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java @@ -298,6 +298,7 @@ public class CommonConfig { private double pipeReceiverActualToEstimatedMemoryRatio = 3; private int pipeReceiverReqDecompressedMaxLengthInBytes = 1073741824; // 1GB + private boolean pipeReceiverLoadConversionEnabled = false; private double pipeMetaReportMaxLogNumPerRound = 0.1; private int pipeMetaReportMaxLogIntervalRounds = 360; @@ -1503,6 +1504,18 @@ public void setPipeReceiverReqDecompressedMaxLengthInBytes( pipeReceiverReqDecompressedMaxLengthInBytes); } + public boolean isPipeReceiverLoadConversionEnabled() { + return pipeReceiverLoadConversionEnabled; + } + + public void setPipeReceiverLoadConversionEnabled(boolean pipeReceiverLoadConversionEnabled) { + if (this.pipeReceiverLoadConversionEnabled == pipeReceiverLoadConversionEnabled) { + return; + } + this.pipeReceiverLoadConversionEnabled = pipeReceiverLoadConversionEnabled; + logger.info("pipeReceiverConversionEnabled is set to {}.", pipeReceiverLoadConversionEnabled); + } + public int getPipeReceiverReqDecompressedMaxLengthInBytes() { return pipeReceiverReqDecompressedMaxLengthInBytes; } diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java index dd540cc5f27ff..39f93fea5afdb 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java @@ -343,6 +343,10 @@ public int getPipeReceiverReqDecompressedMaxLengthInBytes() { return COMMON_CONFIG.getPipeReceiverReqDecompressedMaxLengthInBytes(); } + public boolean isPipeReceiverLoadConversionEnabled() { + return COMMON_CONFIG.isPipeReceiverLoadConversionEnabled(); + } + /////////////////////////////// Logger /////////////////////////////// public double getPipeMetaReportMaxLogNumPerRound() { @@ -574,6 +578,7 @@ public void printAllConfigs() { LOGGER.info( "PipeReceiverReqDecompressedMaxLengthInBytes: {}", getPipeReceiverReqDecompressedMaxLengthInBytes()); + LOGGER.info("PipeReceiverLoadConversionEnabled: {}", isPipeReceiverLoadConversionEnabled()); LOGGER.info("PipeMetaReportMaxLogNumPerRound: {}", getPipeMetaReportMaxLogNumPerRound()); LOGGER.info("PipeMetaReportMaxLogIntervalRounds: {}", getPipeMetaReportMaxLogIntervalRounds()); diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java index 7e27838618b0a..7bdfab83efa1f 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java @@ -432,6 +432,11 @@ public static void loadPipeInternalConfig(CommonConfig config, TrimProperties pr properties.getProperty( "pipe_receiver_req_decompressed_max_length_in_bytes", String.valueOf(config.getPipeReceiverReqDecompressedMaxLengthInBytes())))); + config.setPipeReceiverLoadConversionEnabled( + Boolean.parseBoolean( + properties.getProperty( + "pipe_receiver_load_conversion_enabled", + String.valueOf(config.isPipeReceiverLoadConversionEnabled())))); config.setPipeMemoryAllocateMaxRetries( Integer.parseInt( diff --git a/pom.xml b/pom.xml index 2ae4f3a04e44b..7b9cbbe367387 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,7 @@ distribution example library-udf + integration-test From d6f4b3f3cd1d92d6e2a037fabea5d3006e0ed03f Mon Sep 17 00:00:00 2001 From: Caideyipi <87789683+Caideyipi@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:52:23 +0800 Subject: [PATCH 2/2] revert-cp --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b9cbbe367387..2ae4f3a04e44b 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,6 @@ distribution example library-udf - integration-test