fix delete file bug when do checkpoint (#1138)
This commit is contained in:
parent
8dfa980cba
commit
590e2617ee
@ -211,15 +211,14 @@ Status CheckpointImpl::CreateCheckpoint(const std::string& checkpoint_dir) {
|
|||||||
std::vector<std::string> subchildren;
|
std::vector<std::string> subchildren;
|
||||||
db_->GetEnv()->GetChildren(full_private_path, &subchildren);
|
db_->GetEnv()->GetChildren(full_private_path, &subchildren);
|
||||||
for (auto& subchild : subchildren) {
|
for (auto& subchild : subchildren) {
|
||||||
Status s1 = db_->GetEnv()->DeleteFile(full_private_path + subchild);
|
std::string subchild_path = full_private_path + "/" + subchild;
|
||||||
if (s1.ok()) {
|
Status s1 = db_->GetEnv()->DeleteFile(subchild_path);
|
||||||
Log(db_->GetOptions().info_log, "Deleted %s",
|
Log(db_->GetOptions().info_log, "Delete file %s -- %s",
|
||||||
(full_private_path + subchild).c_str());
|
subchild_path.c_str(), s1.ToString().c_str());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// finally delete the private dir
|
// finally delete the private dir
|
||||||
Status s1 = db_->GetEnv()->DeleteDir(full_private_path);
|
Status s1 = db_->GetEnv()->DeleteDir(full_private_path);
|
||||||
Log(db_->GetOptions().info_log, "Deleted dir %s -- %s",
|
Log(db_->GetOptions().info_log, "Delete dir %s -- %s",
|
||||||
full_private_path.c_str(), s1.ToString().c_str());
|
full_private_path.c_str(), s1.ToString().c_str());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user