From 590e2617ee9204f465770de69dac48947925a3b4 Mon Sep 17 00:00:00 2001 From: Zuoyan Qin Date: Mon, 30 May 2016 05:26:55 +0800 Subject: [PATCH] fix delete file bug when do checkpoint (#1138) --- utilities/checkpoint/checkpoint.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utilities/checkpoint/checkpoint.cc b/utilities/checkpoint/checkpoint.cc index b8543bb5b..ff89f2446 100644 --- a/utilities/checkpoint/checkpoint.cc +++ b/utilities/checkpoint/checkpoint.cc @@ -211,15 +211,14 @@ Status CheckpointImpl::CreateCheckpoint(const std::string& checkpoint_dir) { std::vector subchildren; db_->GetEnv()->GetChildren(full_private_path, &subchildren); for (auto& subchild : subchildren) { - Status s1 = db_->GetEnv()->DeleteFile(full_private_path + subchild); - if (s1.ok()) { - Log(db_->GetOptions().info_log, "Deleted %s", - (full_private_path + subchild).c_str()); - } + std::string subchild_path = full_private_path + "/" + subchild; + Status s1 = db_->GetEnv()->DeleteFile(subchild_path); + Log(db_->GetOptions().info_log, "Delete file %s -- %s", + subchild_path.c_str(), s1.ToString().c_str()); } // finally delete the private dir 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()); return s; }