Skip to content

Commit ec7fbda

Browse files
authored
Fix sync objectNode error log (#16939)
1 parent 2bdbd41 commit ec7fbda

File tree

1 file changed

+6
-2
lines changed
  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write

1 file changed

+6
-2
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/ObjectNode.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public ByteBuffer serialize() {
255255
ReadWriteIOUtils.write(getType().getNodeType(), stream);
256256
byte[] contents = new byte[contentLength];
257257
boolean readSuccess = false;
258+
IOException ioException = null;
258259
for (int i = 0; i < 2; i++) {
259260
Optional<File> objectFile =
260261
TierManager.getInstance().getAbsoluteObjectFilePath(filePath.toString());
@@ -263,7 +264,7 @@ public ByteBuffer serialize() {
263264
readContentFromFile(objectFile.get(), contents);
264265
readSuccess = true;
265266
} catch (IOException e) {
266-
LOGGER.error("Error when read object file {}.", objectFile.get(), e);
267+
ioException = e;
267268
}
268269
if (readSuccess) {
269270
break;
@@ -276,13 +277,16 @@ public ByteBuffer serialize() {
276277
readContentFromFile(objectTmpFile.get(), contents);
277278
readSuccess = true;
278279
} catch (IOException e) {
279-
LOGGER.error("Error when read tmp object file {}.", objectTmpFile.get(), e);
280+
ioException = e;
280281
}
281282
if (readSuccess) {
282283
break;
283284
}
284285
}
285286
}
287+
if (!readSuccess && LOGGER.isDebugEnabled()) {
288+
LOGGER.debug("Error when read object file {}.", filePath.toString(), ioException);
289+
}
286290
ReadWriteIOUtils.write(readSuccess && isEOF, stream);
287291
ReadWriteIOUtils.write(offset, stream);
288292
filePath.serialize(stream);

0 commit comments

Comments
 (0)