This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/object_type by this push:
new 5ed015192dd fix iotv1 bug
5ed015192dd is described below
commit 5ed015192dda26692dc9ed86dabaf958b4f7e9b5
Author: HTHou <[email protected]>
AuthorDate: Thu Jul 10 11:04:22 2025 +0800
fix iotv1 bug
---
dependencies.json | 2 +-
.../plan/planner/plan/node/write/ObjectNode.java | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dependencies.json b/dependencies.json
index 1f8f06da726..02277833728 100644
--- a/dependencies.json
+++ b/dependencies.json
@@ -102,7 +102,7 @@
"com.timecho.ratis:ratis-proto",
"com.timecho.ratis:ratis-server",
"com.timecho.ratis:ratis-server-api",
- "org.apache.ratis:ratis-thirdparty-misc",
+ "org.apache.ratis:】-thirdparty-misc",
"org.apache.thrift:libthrift",
"org.apache.tsfile:common",
"org.apache.tsfile:tsfile",
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/ObjectNode.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/ObjectNode.java
index a9d1ef456d0..9f06070b9ff 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/ObjectNode.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/ObjectNode.java
@@ -273,8 +273,8 @@ public class ObjectNode extends SearchNode implements
WALEntryValue {
ReadWriteIOUtils.write(offset, stream);
ReadWriteIOUtils.write(filePath, stream);
ReadWriteIOUtils.write(contentLength, stream);
- Optional<File> objectFile =
TierManager.getInstance().getAbsoluteObjectFilePath(filePath);
byte[] contents = new byte[contentLength];
+ Optional<File> objectFile =
TierManager.getInstance().getAbsoluteObjectFilePath(filePath);
if (objectFile.isPresent()) {
try (RandomAccessFile raf = new RandomAccessFile(objectFile.get(),
"r")) {
raf.seek(offset);
@@ -283,7 +283,18 @@ public class ObjectNode extends SearchNode implements
WALEntryValue {
throw new RuntimeException(e);
}
} else {
- throw new ObjectFileNotExist(filePath);
+ Optional<File> objectTmpFile =
+ TierManager.getInstance().getAbsoluteObjectFilePath(filePath +
".tmp");
+ if (objectTmpFile.isPresent()) {
+ try (RandomAccessFile raf = new
RandomAccessFile(objectTmpFile.get(), "r")) {
+ raf.seek(offset);
+ raf.read(contents);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ throw new ObjectFileNotExist(filePath);
+ }
}
stream.write(contents);
return ByteBuffer.wrap(byteArrayOutputStream.getBuf(), 0,
byteArrayOutputStream.size());