提交 bd9f1d2d 编写于 作者: Y Yanqin Jin 提交者: Facebook Github Bot

Fix RocksDB auto-recovery from SpaceLimit err (#5334)

Summary:
If RocksDB is configured with a positive max_allowed_space (via sst file manager),
then the sst file manager should use this value instead of total free disk
space to determine whether to clear the background error of space limit
reached.

In DBSSTTest.DBWithMaxSpaceAllowed, we configure a low space limit that is very
likely lower than the free disk space of the test machine. Therefore, once the
test db encounters a Status::SpaceLimit, error handler will call into sst file
manager to start error recovery which may clear the bg error since disk free
space is larger than reserved_disk_buffer_.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5334

Differential Revision: D15501622

Pulled By: riversand963

fbshipit-source-id: 58035efc450b062d6b28c78c322005ec3705fb47
上级 b09c018b
...@@ -266,6 +266,9 @@ void SstFileManagerImpl::ClearError() { ...@@ -266,6 +266,9 @@ void SstFileManagerImpl::ClearError() {
uint64_t free_space; uint64_t free_space;
Status s = env_->GetFreeSpace(path_, &free_space); Status s = env_->GetFreeSpace(path_, &free_space);
free_space = max_allowed_space_ > 0
? std::min(max_allowed_space_, free_space)
: free_space;
if (s.ok()) { if (s.ok()) {
// In case of multi-DB instances, some of them may have experienced a // In case of multi-DB instances, some of them may have experienced a
// soft error and some a hard error. In the SstFileManagerImpl, a hard // soft error and some a hard error. In the SstFileManagerImpl, a hard
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册