The idea is borrowed from RocksDB bytes_per_sync. It uses sync_file_range1 that allows asynchronously incrementally sync files to disk while they are being written.
It smoothes out write I/Os over time and reduce fdatasync latency spike as we saw in #346 (comment) .
Note: The feature proposed here is different from the deprecated bytes_per_sync feature which sync file synchronously.