You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2024/04/24 15:26:37 UTC

(iotdb) branch pipe-no-fsync created (now 03c88156445)

This is an automated email from the ASF dual-hosted git repository.

rong pushed a change to branch pipe-no-fsync
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 03c88156445 Pipe: remove unnecessary fsync operations for file pieces' transferring

This branch includes the following new commits:

     new 03c88156445 Pipe: remove unnecessary fsync operations for file pieces' transferring

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: Pipe: remove unnecessary fsync operations for file pieces' transferring

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch pipe-no-fsync
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 03c8815644547149bc31d017b3db7b43334aa4b5
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Wed Apr 24 23:26:07 2024 +0800

    Pipe: remove unnecessary fsync operations for file pieces' transferring
---
 .../pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java | 1 -
 .../org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java   | 6 +-----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
index e2e57763432..3fb132523d8 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
@@ -293,7 +293,6 @@ public class IoTDBLegacyPipeReceiverAgent {
       byte[] byteArray = new byte[length];
       buff.get(byteArray);
       randomAccessFile.write(byteArray);
-      randomAccessFile.getFD().sync();
       recordStartIndex(new File(fileDir, fileName), startIndex + length);
       LOGGER.debug("Sync {} start at {} to {} is done.", fileName, startIndex, startIndex + length);
     } catch (IOException e) {
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
index c6c7f12e2e4..b60dd1d5e1c 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
@@ -233,8 +233,7 @@ public abstract class IoTDBFileReceiver implements IoTDBReceiver {
   protected final TPipeTransferResp handleTransferFilePiece(
       final PipeTransferFilePieceReq req,
       final boolean isRequestThroughAirGap,
-      final boolean isSingleFile)
-      throws IOException {
+      final boolean isSingleFile) {
     try {
       updateWritingFileIfNeeded(req.getFileName(), isSingleFile);
 
@@ -265,7 +264,6 @@ public abstract class IoTDBFileReceiver implements IoTDBReceiver {
       }
 
       writingFileWriter.write(req.getFilePiece());
-      writingFileWriter.getFD().sync();
       return PipeTransferFilePieceResp.toTPipeTransferResp(
           RpcUtils.SUCCESS_STATUS, writingFileWriter.length());
     } catch (Exception e) {
@@ -435,7 +433,6 @@ public abstract class IoTDBFileReceiver implements IoTDBReceiver {
       // updateWritingFileIfNeeded#isFileExistedAndNameCorrect, and continue to write to the already
       // loaded file. Since the writing file writer has already been closed, it will throw a Stream
       // Close exception.
-      writingFileWriter.getFD().sync();
       writingFileWriter.close();
       writingFileWriter = null;
 
@@ -512,7 +509,6 @@ public abstract class IoTDBFileReceiver implements IoTDBReceiver {
       // updateWritingFileIfNeeded#isFileExistedAndNameCorrect, and continue to write to the already
       // loaded file. Since the writing file writer has already been closed, it will throw a Stream
       // Close exception.
-      writingFileWriter.getFD().sync();
       writingFileWriter.close();
       writingFileWriter = null;