Skip to content

Commit 64929a4

Browse files
committed
Deal with iter errors
Signed-off-by: v01dstar <[email protected]>
1 parent d362e9e commit 64929a4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/blob_gc_job.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ Status BlobGCJob::HolePunchSingleBlobFile(std::shared_ptr<BlobFileMeta> file) {
221221
return Status::NotSupported("Hole punch not supported");
222222
#endif
223223
}
224+
if (!iter->status().ok()) {
225+
return iter->status();
226+
}
224227
hole_punched_files_map_[file->file_number()] = live_blocks;
225228
return Status::OK();
226229
}
@@ -467,7 +470,7 @@ Status BlobGCJob::DiscardEntry(const Slice& key, const BlobIndex& blob_index,
467470
// added to db before we rewrite any key to LSM
468471
Status BlobGCJob::Finish() {
469472
Status s;
470-
{
473+
if (!blob_gc_->use_punch_hole()) {
471474
mutex_->Unlock();
472475
s = InstallOutputBlobFiles();
473476
if (s.ok()) {
@@ -486,8 +489,12 @@ Status BlobGCJob::Finish() {
486489
s.ToString().c_str());
487490
}
488491
mutex_->Lock();
489-
}
490-
if (blob_gc_->use_punch_hole()) {
492+
if (s.ok() && !blob_gc_->GetColumnFamilyData()->IsDropped()) {
493+
TEST_SYNC_POINT("BlobGCJob::Finish::BeforeDeleteInputBlobFiles");
494+
s = DeleteInputBlobFiles();
495+
}
496+
TEST_SYNC_POINT("BlobGCJob::Finish::AfterRewriteValidKeyToLSM");
497+
} else {
491498
TITAN_LOG_INFO(db_options_.info_log,
492499
"Titan GC job finished, before batch updates");
493500
// It is possible that while processing the GC job, the input blob files'
@@ -515,13 +522,6 @@ Status BlobGCJob::Finish() {
515522
s = blob_file_manager_->BatchUpdateFiles(hole_punched_files);
516523
}
517524
}
518-
if (s.ok() && !blob_gc_->GetColumnFamilyData()->IsDropped() &&
519-
!blob_gc_->use_punch_hole()) {
520-
TEST_SYNC_POINT("BlobGCJob::Finish::BeforeDeleteInputBlobFiles");
521-
s = DeleteInputBlobFiles();
522-
}
523-
TEST_SYNC_POINT("BlobGCJob::Finish::AfterRewriteValidKeyToLSM");
524-
525525
if (s.ok()) {
526526
UpdateInternalOpStats();
527527
}

0 commit comments

Comments
 (0)