This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch tsfile-tablet-converter
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/tsfile-tablet-converter by
this push:
new 3c628336a86 Update PipeStatementDataTypeConvertExecutionVisitor.java
3c628336a86 is described below
commit 3c628336a86d8d66452aecc1b7a7af1ac80c7179
Author: Steve Yurong Su <[email protected]>
AuthorDate: Tue Aug 20 15:57:40 2024 +0800
Update PipeStatementDataTypeConvertExecutionVisitor.java
---
...ipeStatementDataTypeConvertExecutionVisitor.java | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
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 b7b82660fc8..7bc3e3d4cb5 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
@@ -86,18 +86,27 @@ public class PipeStatementDataTypeConvertExecutionVisitor
final LoadTsFileStatement loadTsFileStatement, final TSStatus status) {
// TODO: judge if the exception is caused by data type mismatch
// TODO: convert the data type of the statement
+ LOGGER.error(
+ "Failed to execute LoadTsFileStatement and try to exec data type
conversion. LoadTsFileStatement: {}. Status: {}",
+ loadTsFileStatement,
+ status);
for (final File file : loadTsFileStatement.getTsFiles()) {
try (final TsFileInsertionScanDataContainer container =
new TsFileInsertionScanDataContainer(
file, new IoTDBPipePattern(null), Long.MIN_VALUE,
Long.MAX_VALUE, null, null)) {
for (final Tablet tablet : container.toTablets()) {
- final TSStatus result =
- statementExecutor.execute(
- new PipeConvertedInsertTabletStatement(
- PipeTransferTabletRawReq.toTPipeTransferRawReq(tablet,
false)
- .constructStatement()));
- // TODO: handle memory not enough
+ final PipeConvertedInsertTabletStatement statement =
+ new PipeConvertedInsertTabletStatement(
+ PipeTransferTabletRawReq.toTPipeTransferRawReq(tablet, false)
+ .constructStatement());
+ TSStatus result = statementExecutor.execute(statement);
+
+ // Retry once if the write process is rejected
+ if (result.getCode() ==
TSStatusCode.WRITE_PROCESS_REJECT.getStatusCode()) {
+ result = statementExecutor.execute(statement);
+ }
+
if (!(result.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
|| result.getCode() ==
TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode())) {
return Optional.empty();