mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
1a8e9f0e07
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:
|
||
---|---|---|
.. | ||
amalgamate.py | ||
build_detect_platform | ||
check-sources.sh | ||
dependencies.sh | ||
dependencies_4.8.1.sh | ||
dependencies_platform007.sh | ||
dependencies_platform009.sh | ||
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 | ||
format-diff.sh | ||
gnu_parallel | ||
make_package.sh | ||
precommit_checker.py | ||
regression_build_test.sh | ||
rocksdb-lego-determinator | ||
run_ci_db_test.ps1 | ||
setup_centos7.sh | ||
update_dependencies.sh | ||
version.sh |