[improve](disk) Not add disk path to broken list if check status is not IO_ERROR (#34111)

This commit is contained in:
zxealous
2024-04-25 21:32:16 +08:00
committed by yiguolei
parent 7af5fc7321
commit 9aa08d8deb
2 changed files with 2 additions and 1 deletions

View File

@ -239,7 +239,7 @@ void DataDir::health_check() {
// check disk
if (_is_used) {
Status res = _read_and_write_test_file();
if (!res) {
if (!res && res.is<IO_ERROR>()) {
LOG(WARNING) << "store read/write test file occur IO Error. path=" << _path
<< ", err: " << res;
StorageEngine::instance()->add_broken_path(_path);

View File

@ -435,6 +435,7 @@ int main(int argc, char** argv) {
it = paths.erase(it);
} else {
LOG(ERROR) << "read write test file failed, path=" << it->path;
// if only one disk and the disk is full, also need exit because rocksdb will open failed
exit(-1);
}
} else {