mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 07:30:54 +00:00
9e72939029
Summary: In RocksDB, we sometimes preallocate the estimated space for a file to have better perf with fallocate (if supported). Usually it is a little bit bigger than the real resulting file size. At this time, we have to let the Filesystem reclaim the space not used. Ideally, calling ftruncate to truncate the file to its real size should be enough. HOWEVER, it isn't on tmpfs, which we witness in our case, with some buggy kernel version. ftruncate a file with preallocated space doesn't change number of the blocks used by the file, which means the space not used by the file is not returned to the filesystems. So in this case we need fallocate with FALLOC_FL_PUNCH_HOLE to explicitly reclaim the used blocks. It is a hack to cope with the kernel bug and usually we should not need it. Closes https://github.com/facebook/rocksdb/pull/2102 Differential Revision: D4848934 Pulled By: lightmark fbshipit-source-id: f1b40b5 |
||
---|---|---|
.. | ||
env.cc | ||
env_basic_test.cc | ||
env_chroot.cc | ||
env_chroot.h | ||
env_hdfs.cc | ||
env_posix.cc | ||
env_test.cc | ||
io_posix.cc | ||
io_posix.h | ||
memenv.cc | ||
mock_env.cc | ||
mock_env.h | ||
mock_env_test.cc | ||
posix_logger.h |