shuwenwei commented on code in PR #13984:
URL: https://github.com/apache/iotdb/pull/13984#discussion_r1827385467
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java:
##########
@@ -427,6 +427,10 @@ private TPipeConsensusTransferResp
handleTransferFileSeal(final PipeConsensusTsF
// loaded file. Since the writing file writer has already been closed,
it will throw a Stream
// Close exception.
writingFileWriter.close();
+ // Sync here is necessary to ensure that the data is written to the
disk. Or data region may
+ // load the file before the data is written to the disk and cause
unexpected behavior after
+ // system restart. (e.g., empty file in data region's data directory)
+ writingFileWriter.getFD().sync();
Review Comment:
Will there be an exception when syncing after obtaining the FD after close?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]