1
0
Fork 0

dont attempt to remove non-existing WAL files (#8474)

This commit is contained in:
Jan 2019-03-20 17:58:28 +01:00 committed by GitHub
parent aa165b7674
commit 0bef1c1098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1783,7 +1783,15 @@ void RocksDBEngine::pruneWalFiles() {
if (deleteFile) {
LOG_TOPIC(DEBUG, Logger::ENGINES)
<< "deleting RocksDB WAL file '" << (*it).first << "'";
auto s = _db->DeleteFile((*it).first);
rocksdb::Status s;
if (basics::FileUtils::exists(basics::FileUtils::buildFilename(_options.wal_dir, (*it).first))) {
// only attempt file deletion if the file actually exists.
// otherwise RocksDB may complain about non-existing files and log a big error message
s = _db->DeleteFile((*it).first);
} else {
LOG_TOPIC(DEBUG, Logger::ROCKSDB)
<< "to-be-deleted RocksDB WAL file '" << (*it).first << "' does not exist. skipping deletion";
}
// apparently there is a case where a file was already deleted
// but is still in _prunableWalFiles. In this case we get an invalid
// argument response.