Fix a bug. Where DestroyDB deletes a non-existant archive directory.

Summary:
C tests would fail sometimes as DestroyDB would return a Failure Status
message when deleting an archival directory which was not created
(WAL_ttl_seconds = 0).

Fix: Ignore the Status returned on Deleting Archival Directory.

Test Plan: * make check

Reviewers: dhruba, emayanke

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D7395
This commit is contained in:
Abhishek Kona 2012-12-14 13:21:53 -08:00
parent 3d9ff0e921
commit 2f0585fb97

View File

@ -2348,10 +2348,8 @@ Status DestroyDB(const std::string& dbname, const Options& options) {
} }
} }
} }
Status del = env->DeleteDir(ArchivalDirectory(dbname)); // ignore case where no archival directory is present.
if (result.ok() && !del.ok()) { env->DeleteDir(ArchivalDirectory(dbname));
result = del;
}
env->UnlockFile(lock); // Ignore error since state is already gone env->UnlockFile(lock); // Ignore error since state is already gone
env->DeleteFile(lockname); env->DeleteFile(lockname);