Skip to content

Commit

Permalink
Fix status overrided by mistake (#111) (#113)
Browse files Browse the repository at this point in the history
* fix status override

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
  • Loading branch information
sre-bot authored and Connor1996 committed Nov 19, 2019
1 parent 43225d4 commit 552cebf
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/blob_gc_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,20 @@ Status BlobGCJob::InstallOutputBlobFiles() {
to_delete_files.append(std::to_string(builder.first->GetNumber()));
handles.emplace_back(std::move(builder.first));
}
ROCKS_LOG_BUFFER(
log_buffer_,
"[%s] InstallOutputBlobFiles failed. Delete GC output files: %s",
blob_gc_->column_family_handle()->GetName().c_str(),
to_delete_files.c_str());
s = blob_file_manager_->BatchDeleteFiles(handles);
ROCKS_LOG_BUFFER(log_buffer_,
"[%s] InstallOutputBlobFiles failed. Delete GC output "
"files: %s",
blob_gc_->column_family_handle()->GetName().c_str(),
to_delete_files.c_str());
// Do not set status `s` here, cause it may override the non-okay-status of
// `s` so that in the outer funcation it will rewrite blob indexes to LSM by
// mistake.
Status status = blob_file_manager_->BatchDeleteFiles(handles);
if (!status.ok()) {
ROCKS_LOG_WARN(db_options_.info_log,
"Delete GC output files[%s] failed: %s",
to_delete_files.c_str(), status.ToString().c_str());
}
}
return s;
}
Expand Down

0 comments on commit 552cebf

Please sign in to comment.