cyb70289 commented on code in PR #13662:
URL: https://github.com/apache/arrow/pull/13662#discussion_r929482951
##########
cpp/src/arrow/util/io_util.cc:
##########
@@ -1115,7 +1116,9 @@ Result<FileDescriptor> FileOpenWritable(const
PlatformFilename& file_name,
fd = FileDescriptor(ret);
#else
int oflag = O_CREAT;
-
+ if (sync) {
+ oflag |= O_SYNC;
Review Comment:
Just for discussion.
My understanding is O_SYNC (O_DSYNC might be better) is necessary as fadvise
won't drop dirty pages.
If that's the only reason to add this flag, looks to me it's better sync
data explicitly before fadvise.
```
write(fd, buffer, size);
fdatasync(fd); // explicitly flush fd
fadvise(fd, dontneed);
```
--
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]