rocksdb/test_util
Yi Wu 2730fe693e Fix ingested file and direcotry not being sync (#5435)
Summary:
It it not safe to assume application had sync the SST file before ingest it into DB. Also the directory to put the ingested file needs to be fsync, otherwise the file can be lost. For integrity of RocksDB we need to sync the ingested file and directory before apply the change to manifest.

Also syncing after writing global sequence when write_global_seqno=true was removed in https://github.com/facebook/rocksdb/issues/4172. Adding it back.

Fixes https://github.com/facebook/rocksdb/issues/5287.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5435

Test Plan:
Test ingest file with ldb command and observe fsync/fdatasync in strace output. Tried both move_files=true and move_files=false.
https://gist.github.com/yiwu-arbug/650a4023f57979056d83485fa863bef9

More test suggestions are welcome.

Differential Revision: D15941675

Pulled By: riversand963

fbshipit-source-id: 389533f3923065a96df2cdde23ff4724a1810d78
2019-06-21 10:15:38 -07:00
..
fault_injection_test_env.cc Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
fault_injection_test_env.h Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
mock_time_env.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point_impl.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point_impl.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testharness.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testharness.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testutil.cc Call ValidateOptions from SetOptions (#5368) 2019-06-03 19:49:57 -07:00
testutil.h Call ValidateOptions from SetOptions (#5368) 2019-06-03 19:49:57 -07:00
transaction_test_util.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
transaction_test_util.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00