src/blob_gc_job.cc
// We have to make sure crash consistency, but LSM db MANIFEST and BLOB db
// MANIFEST are separate, so we need to make sure all new blob file have
// added to db before we rewrite any key to LSM
We have to make sure crash consistency, but LSM db MANIFEST and BLOB db
MANIFEST are separate, so we need to make sure all new blob file have
added to db before we rewrite any key to LSM
We have to make sure crash consistency but LSM db MANIFEST and BLOB db MANIFEST are separate so we need to make sure all new blob file have added to db before we rewrite any key to LSM
Status BlobGCJob::Finish() {
  Status s;
  {
    mutex_->Unlock();
    s = InstallOutputBlobFiles();
    if (s.ok()) {
      TEST_SYNC_POINT("BlobGCJob::Finish::BeforeRewriteValidKeyToLSM");
      s = RewriteValidKeyToLSM();
      if (!s.ok()) {
        TITAN_LOG_ERROR(db_options_.info_log,
                        "[%s] GC job failed to rewrite keys to LSM: %s",
                        blob_gc_->column_family_handle()->GetName().c_str(),
                        s.ToString().c_str());
      }
    } else {
      TITAN_LOG_ERROR(db_options_.info_log,
                      "[%s] GC job failed to install output blob files: %s",
                      blob_gc_->column_family_handle()->GetName().c_str(),
                      s.ToString().c_str());
    }
    mutex_->Lock();
  }
  if (s.ok() && !blob_gc_->GetColumnFamilyData()->IsDropped()) {
    s = DeleteInputBlobFiles();
  }
  TEST_SYNC_POINT("BlobGCJob::Finish::AfterRewriteValidKeyToLSM");
  if (s.ok()) {
    UpdateInternalOpStats();
  }
  return s;
}
Status BlobGCJob :: Finish ( ) { Status s ; { mutex_ -> Unlock ( ) ; s = InstallOutputBlobFiles ( ) ; if ( s . ok ( ) ) { TEST_SYNC_POINT ( " " ) ; s = RewriteValidKeyToLSM ( ) ; if ( ! s . ok ( ) ) { TITAN_LOG_ERROR ( db_options_ . info_log , " " , blob_gc_ -> column_family_handle ( ) -> GetName ( ) . c_str ( ) , s . ToString ( ) . c_str ( ) ) ; } } else { TITAN_LOG_ERROR ( db_options_ . info_log , " " , blob_gc_ -> column_family_handle ( ) -> GetName ( ) . c_str ( ) , s . ToString ( ) . c_str ( ) ) ; } mutex_ -> Lock ( ) ; } if ( s . ok ( ) && ! blob_gc_ -> GetColumnFamilyData ( ) -> IsDropped ( ) ) { s = DeleteInputBlobFiles ( ) ; } TEST_SYNC_POINT ( " " ) ; if ( s . ok ( ) ) { UpdateInternalOpStats ( ) ; } return s ; }
We have to make sure crash consistency, but LSM db MANIFEST and BLOB db
MANIFEST are separate, so we need to make sure all new blob file have
added to db before we rewrite any key to LSM
We have to make sure crash consistency but LSM db MANIFEST and BLOB db MANIFEST are separate so we need to make sure all new blob file have added to db before we rewrite any key to LSM