@@ -221,6 +221,9 @@ Status BlobGCJob::HolePunchSingleBlobFile(std::shared_ptr<BlobFileMeta> file) {
221
221
return Status::NotSupported (" Hole punch not supported" );
222
222
#endif
223
223
}
224
+ if (!iter->status ().ok ()) {
225
+ return iter->status ();
226
+ }
224
227
hole_punched_files_map_[file->file_number ()] = live_blocks;
225
228
return Status::OK ();
226
229
}
@@ -467,7 +470,7 @@ Status BlobGCJob::DiscardEntry(const Slice& key, const BlobIndex& blob_index,
467
470
// added to db before we rewrite any key to LSM
468
471
Status BlobGCJob::Finish () {
469
472
Status s;
470
- {
473
+ if (!blob_gc_-> use_punch_hole ()) {
471
474
mutex_->Unlock ();
472
475
s = InstallOutputBlobFiles ();
473
476
if (s.ok ()) {
@@ -486,8 +489,12 @@ Status BlobGCJob::Finish() {
486
489
s.ToString ().c_str ());
487
490
}
488
491
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 {
491
498
TITAN_LOG_INFO (db_options_.info_log ,
492
499
" Titan GC job finished, before batch updates" );
493
500
// It is possible that while processing the GC job, the input blob files'
@@ -515,13 +522,6 @@ Status BlobGCJob::Finish() {
515
522
s = blob_file_manager_->BatchUpdateFiles (hole_punched_files);
516
523
}
517
524
}
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
-
525
525
if (s.ok ()) {
526
526
UpdateInternalOpStats ();
527
527
}
0 commit comments