rocksdb/env
matthewvon 5a2b4ed671 BugFix: fs_posix.cc GetFreeSpace uses wrong value non-root users (#8370)
Summary:
fs_posix.cc GetFreeSpace() calculates free space based upon a call to statvfs().  However, there are two extremely different values in statvfs's returned structure:  f_bfree which is free space for root and f_bavail which is free space for non-root users.  The existing code uses f_bfree.  Many disks have 5 to 10% of the total disk space reserved for root only.  Therefore GetFreeSpace() does not realize that non-root users may not have storage available.

This PR detects whether the effective posix user is root or not, then selects the appropriate available space value.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8370

Reviewed By: mrambacher

Differential Revision: D29032710

Pulled By: jay-zhuang

fbshipit-source-id: 57feba34ed035615a479956d28f98d85735281c0
2021-06-10 11:11:54 -07:00
..
composite_env_wrapper.h Integrated BlobDB for backup/restore support (#8129) 2021-04-07 13:38:54 -07:00
composite_env.cc Add new Append API with DataVerificationInfo to Env WritableFile (#8071) 2021-03-19 11:44:13 -07:00
env_basic_test.cc Improvements to Env::GetChildren (#7819) 2021-01-09 09:44:34 -08:00
env_chroot.cc Make backups openable as read-only DBs (#8142) 2021-04-06 14:37:53 -07:00
env_chroot.h Make backups openable as read-only DBs (#8142) 2021-04-06 14:37:53 -07:00
env_encryption_ctr.h Changes to EncryptedEnv public API (#7279) 2020-09-15 17:14:10 -07:00
env_encryption.cc Fix unittest no space issue (#8204) 2021-04-20 08:42:28 -07:00
env_hdfs.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env_posix.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env_test.cc Fix test issue in new env_test tests (#8319) 2021-05-19 10:59:02 -07:00
env.cc Integrated BlobDB for backup/restore support (#8129) 2021-04-07 13:38:54 -07:00
file_system_tracer.cc Add request_id in IODebugContext. (#8045) 2021-04-01 13:14:51 -07:00
file_system_tracer.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
file_system.cc Integrated BlobDB for backup/restore support (#8129) 2021-04-07 13:38:54 -07:00
fs_posix.cc BugFix: fs_posix.cc GetFreeSpace uses wrong value non-root users (#8370) 2021-06-10 11:11:54 -07:00
fs_readonly.h Fix crash test with backup as read-only DB (#8161) 2021-04-06 23:31:51 -07:00
fs_remap.cc Make backups openable as read-only DBs (#8142) 2021-04-06 14:37:53 -07:00
fs_remap.h Fix crash test with backup as read-only DB (#8161) 2021-04-06 23:31:51 -07:00
io_posix_test.cc Status check enforcement for io_posix_test and options_settable_test (#6857) 2020-05-19 19:22:28 -07:00
io_posix.cc Handle return code by io_uring_submit_and_wait() and io_uring_wait_cqe() (#8311) 2021-05-18 16:09:14 -07:00
io_posix.h Add AppendWithVerify and PositionedAppendWithVerify to Env and FileSystem (#7419) 2020-09-23 19:02:26 -07:00
mock_env_test.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
mock_env.cc Always truncate the latest WAL file on DB Open (#8122) 2021-03-28 10:00:08 -07:00
mock_env.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00