rocksdb/build_tools
Yanqin Jin 1a8e9f0e07 Use fcntl(F_FULLFSYNC) on OS X (#9356)
Summary:
Closing https://github.com/facebook/rocksdb/issues/5954

fsync/fdatasync on Linux:
```
(fsync/fdatasync) includes writing through or flushing a disk cache if present.
```

However, on OS X and iOS:
```
(fsync) will flush all data from the host to the drive (i.e. the "permanent storage device"),
the drive itself may not physically write the data to the platters for quite some time and it
may be written in an out-of-order sequence.
```

Solution is to use `fcntl(F_FULLFSYNC)` on OS X so that we get the same
persistence guarantee.

According to OSX man page,
```
The F_FULLFSYNC fcntl asks the drive to flush **all** buffered data to permanent storage.
```
This suggests that it will be no faster than `fsync` on Linux, since Linux, according to its man page,
```
writing through or flushing a disk cache if present
```
It means Linux may not flush **all** data from disk cache.

This is similar to bug reports/fixes in:
- golang: https://github.com/golang/go/issues/26650
- leveldb: 296de8d5b8.

Not sure if we should fallback to fsync since we break persistence contract.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9356

Reviewed By: jay-zhuang

Differential Revision: D33417416

Pulled By: riversand963

fbshipit-source-id: 475548ff9c5eaccde325e0f6842694271cbc8cb7
2022-01-18 20:23:11 -08:00
..
amalgamate.py Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
build_detect_platform Use fcntl(F_FULLFSYNC) on OS X (#9356) 2022-01-18 20:23:11 -08:00
check-sources.sh Add check for using namespace (#9383) 2022-01-12 13:28:24 -08:00
dependencies_4.8.1.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
dependencies_platform007.sh PosixRandomAccessFile::MultiRead() to use I/O uring if supported (#5881) 2019-12-07 20:55:52 -08:00
dependencies_platform009.sh Add microbench build support for fbcode (#8954) 2021-09-24 10:23:35 -07:00
dependencies.sh Update dependencies (#5777) 2019-09-16 20:44:47 -07:00
dockerbuild.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
error_filter.py Enable txn in crash tests (#6155) 2019-12-11 16:01:55 -08:00
fb_compile_mongo.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
fbcode_config4.8.1.sh Makefile support for link-time optimization (#7181) 2020-07-28 13:10:44 -07:00
fbcode_config_platform007.sh Disable DistributedMutex test by default (#8584) 2021-07-23 15:55:23 -07:00
fbcode_config_platform009.sh Add microbench build support for fbcode (#8954) 2021-09-24 10:23:35 -07:00
fbcode_config.sh Makefile support for link-time optimization (#7181) 2020-07-28 13:10:44 -07:00
format-diff.sh Make format-diff.sh locale-independent (#9079) 2021-10-27 12:26:36 -07:00
gnu_parallel More improvements to output for CircleCI (#9201) 2021-11-23 22:10:27 -08:00
make_package.sh Use standard variables for installing/uninstalling with make (#7187) 2020-08-28 14:47:31 -07:00
precommit_checker.py build_tools/precommit_checker.py: don't hard-code a platform-afflicted python path (#6124) 2019-12-05 11:49:17 -08:00
regression_build_test.sh Fix regression test script (#8753) 2021-09-03 19:05:33 -07:00
rocksdb-lego-determinator Enable core dumps in ASAN crash tests (#9330) 2021-12-22 10:14:16 -08:00
run_ci_db_test.ps1 Extract test cases correctly in run_ci_db_test.ps1 script (#7989) 2021-02-23 14:25:42 -08:00
setup_centos7.sh Adding new build script for CentOS 7 (#6617) 2020-04-06 16:20:27 -07:00
update_dependencies.sh PosixRandomAccessFile::MultiRead() to use I/O uring if supported (#5881) 2019-12-07 20:55:52 -08:00
version.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00