Adar Dembo has submitted this change and it was merged.

Change subject: env: do not convert all Flush() calls into fsync() on macOS
......................................................................


env: do not convert all Flush() calls into fsync() on macOS

On Linux, we don't expect sync_file_range() to actually provide durability;
we use it to tell the kernel to start writing back dirty pages while we go
off and do other work. That is, it must be followed up with an fsync() if
durability is actually desired.

To that end, let's only convert Flush() to fsync() if a synchronous flush
was requested. Even then I'm not sure it makes sense (sync_file_range()
explicitly does NOT guarantee durability, even if SYNC_FILE_RANGE_WAIT_AFTER
was used), but at least callers will get the "only return when all dirty
pages have been written out" behavior they probably wanted.

I also snuck in a change to add SYNC_FILE_RANGE_WAIT_BEFORE to the
FLUSH_SYNC case on Linux. It's largely academic (since FLUSH_SYNC is never
actually used), but it's safer if it is ever used for data integrity.

Change-Id: I01bdd8dbaaad0205c0795a87dd973c8bf0fb87dc
Reviewed-on: http://gerrit.cloudera.org:8080/5457
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
---
M src/kudu/util/env_posix.cc
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5457
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I01bdd8dbaaad0205c0795a87dd973c8bf0fb87dc
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>

Reply via email to