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
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.sh
dependencies_4.8.1.sh
dependencies_platform007.sh
dependencies_platform009.sh Add microbench build support for fbcode (#8954) 2021-09-24 10:23:35 -07:00
dockerbuild.sh
error_filter.py
fb_compile_mongo.sh
fbcode_config.sh
fbcode_config4.8.1.sh
fbcode_config_platform007.sh
fbcode_config_platform009.sh Add microbench build support for fbcode (#8954) 2021-09-24 10:23:35 -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
precommit_checker.py
regression_build_test.sh
rocksdb-lego-determinator Enable core dumps in ASAN crash tests (#9330) 2021-12-22 10:14:16 -08:00
run_ci_db_test.ps1
setup_centos7.sh
update_dependencies.sh
version.sh