@ -272,7 +272,7 @@ Status BlobDBImpl::OpenAllBlobFiles() {
continue ;
continue ;
} else if ( ! read_metadata_status . ok ( ) ) {
} else if ( ! read_metadata_status . ok ( ) ) {
ROCKS_LOG_ERROR ( db_options_ . info_log ,
ROCKS_LOG_ERROR ( db_options_ . info_log ,
" Unable to read metadata of blob file % " PRIu64
" Unable to read metadata of blob file % " PRIu64
" , status: '%s' " ,
" , status: '%s' " ,
file_number , read_metadata_status . ToString ( ) . c_str ( ) ) ;
file_number , read_metadata_status . ToString ( ) . c_str ( ) ) ;
return read_metadata_status ;
return read_metadata_status ;
@ -345,8 +345,9 @@ Status BlobDBImpl::CreateWriterLocked(const std::shared_ptr<BlobFile>& bfile) {
uint64_t boffset = bfile - > GetFileSize ( ) ;
uint64_t boffset = bfile - > GetFileSize ( ) ;
if ( debug_level_ > = 2 & & boffset ) {
if ( debug_level_ > = 2 & & boffset ) {
ROCKS_LOG_DEBUG ( db_options_ . info_log , " Open blob file: %s with offset: %d " ,
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
fpath . c_str ( ) , boffset ) ;
" Open blob file: %s with offset: % " PRIu64 , fpath . c_str ( ) ,
boffset ) ;
}
}
Writer : : ElemType et = Writer : : kEtNone ;
Writer : : ElemType et = Writer : : kEtNone ;
@ -356,8 +357,8 @@ Status BlobDBImpl::CreateWriterLocked(const std::shared_ptr<BlobFile>& bfile) {
et = Writer : : kEtRecord ;
et = Writer : : kEtRecord ;
} else if ( bfile - > file_size_ ) {
} else if ( bfile - > file_size_ ) {
ROCKS_LOG_WARN ( db_options_ . info_log ,
ROCKS_LOG_WARN ( db_options_ . info_log ,
" Open blob file: %s with wrong size: %d " , fpath . c_str ( ) ,
" Open blob file: %s with wrong size: % " PRIu64 ,
boffset ) ;
fpath . c_str ( ) , boffset ) ;
return Status : : Corruption ( " Invalid blob file size " ) ;
return Status : : Corruption ( " Invalid blob file size " ) ;
}
}
@ -498,7 +499,8 @@ Status BlobDBImpl::SelectBlobFileTTL(uint64_t expiration,
* blob_file = NewBlobFile ( " SelectBlobFileTTL " ) ;
* blob_file = NewBlobFile ( " SelectBlobFileTTL " ) ;
assert ( * blob_file ! = nullptr ) ;
assert ( * blob_file ! = nullptr ) ;
ROCKS_LOG_INFO ( db_options_ . info_log , " New blob file TTL range: %s %d %d " ,
ROCKS_LOG_INFO ( db_options_ . info_log ,
" New blob file TTL range: %s % " PRIu64 " % " PRIu64 ,
( * blob_file ) - > PathName ( ) . c_str ( ) , exp_low , exp_high ) ;
( * blob_file ) - > PathName ( ) . c_str ( ) , exp_low , exp_high ) ;
LogFlush ( db_options_ . info_log ) ;
LogFlush ( db_options_ . info_log ) ;
@ -736,12 +738,12 @@ Status BlobDBImpl::PutBlobValue(const WriteOptions& /*options*/,
RecordTick ( statistics_ , BLOB_DB_WRITE_BLOB_TTL ) ;
RecordTick ( statistics_ , BLOB_DB_WRITE_BLOB_TTL ) ;
}
}
} else {
} else {
ROCKS_LOG_ERROR ( db_options_ . info_log ,
ROCKS_LOG_ERROR (
" Failed to append blob to FILE: %s: KEY: %s VALSZ: %d "
db_options_ . info_log ,
" status: '%s' blob_file: '%s' " ,
" Failed to append blob to FILE: %s: KEY: %s VALSZ: % " ROCKSDB_PRIszt
blob_file - > PathName ( ) . c_str ( ) , key . ToString ( ) . c_str ( ) ,
" status: '%s' blob_file: '%s' " ,
value . size ( ) , s . ToString ( ) . c_str ( ) ,
blob_file - > PathName ( ) . c_str ( ) , key . ToString ( ) . c_str ( ) , value . size ( ) ,
blob_file - > DumpState ( ) . c_str ( ) ) ;
s . ToString ( ) . c_str ( ) , blob_file - > DumpState ( ) . c_str ( ) ) ;
}
}
}
}
@ -1048,20 +1050,19 @@ Status BlobDBImpl::GetBlobValue(const Slice& key, const Slice& index_entry,
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
" Failed to read blob from blob file % " PRIu64
" Failed to read blob from blob file % " PRIu64
" , blob_offset: % " PRIu64 " , blob_size: % " PRIu64
" , blob_offset: % " PRIu64 " , blob_size: % " PRIu64
" , key_size: " PRIu64 " , read " PRIu64
" , key_size: % " ROCKSDB_PRIszt " , status: '%s' " ,
" bytes, status: '%s' " ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) ,
blob_index . size ( ) , key . size ( ) , s . ToString ( ) . c_str ( ) ) ;
blob_index . size ( ) , key . size ( ) , s . ToString ( ) . c_str ( ) ) ;
return s ;
return s ;
}
}
if ( blob_record . size ( ) ! = record_size ) {
if ( blob_record . size ( ) ! = record_size ) {
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
ROCKS_LOG_DEBUG (
" Failed to read blob from blob file % " PRIu64
db_options_ . info_log ,
" , blob_offset: %" PRIu64 " , blob_siz e: % " PRIu64
" Failed to read blob from blob file %" PRIu64 " , blob_off set : % " PRIu64
" , key_size: " PRIu64 " , read " PRIu64
" , blob_size: % " PRIu64 " , key_size: % " ROCKSDB_PRIszt
" bytes, status: '%s' " ,
" , read % " ROCKSDB_PRIszt " bytes, expected % " PRIu64 " bytes " ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) , blob_index . size ( ) ,
blob_index . size ( ) , key . size ( ) , s . ToString ( ) . c_str ( ) ) ;
key . size ( ) , blob_record . size ( ) , record_size ) ;
return Status : : Corruption ( " Failed to retrieve blob from blob index. " ) ;
return Status : : Corruption ( " Failed to retrieve blob from blob index. " ) ;
}
}
@ -1073,7 +1074,7 @@ Status BlobDBImpl::GetBlobValue(const Slice& key, const Slice& index_entry,
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
ROCKS_LOG_DEBUG ( db_options_ . info_log ,
" Unable to decode CRC from blob file % " PRIu64
" Unable to decode CRC from blob file % " PRIu64
" , blob_offset: % " PRIu64 " , blob_size: % " PRIu64
" , blob_offset: % " PRIu64 " , blob_size: % " PRIu64
" , key size: % " PRIu64 " , status: '%s' " ,
" , key size: % " ROCKSDB_PRIszt " , status: '%s' " ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) ,
bfile - > BlobFileNumber ( ) , blob_index . offset ( ) ,
blob_index . size ( ) , key . size ( ) , s . ToString ( ) . c_str ( ) ) ;
blob_index . size ( ) , key . size ( ) , s . ToString ( ) . c_str ( ) ) ;
return Status : : Corruption ( " Unable to decode checksum. " ) ;
return Status : : Corruption ( " Unable to decode checksum. " ) ;
@ -1174,9 +1175,9 @@ std::pair<bool, int64_t> BlobDBImpl::SanityCheck(bool aborted) {
}
}
ROCKS_LOG_INFO ( db_options_ . info_log , " Starting Sanity Check " ) ;
ROCKS_LOG_INFO ( db_options_ . info_log , " Starting Sanity Check " ) ;
ROCKS_LOG_INFO ( db_options_ . info_log , " Number of files % " PRIu64 ,
ROCKS_LOG_INFO ( db_options_ . info_log , " Number of files % " ROCKSDB_PRIszt ,
blob_files_ . size ( ) ) ;
blob_files_ . size ( ) ) ;
ROCKS_LOG_INFO ( db_options_ . info_log , " Number of open files % " PRIu64 ,
ROCKS_LOG_INFO ( db_options_ . info_log , " Number of open files % " ROCKSDB_PRIszt ,
open_ttl_files_ . size ( ) ) ;
open_ttl_files_ . size ( ) ) ;
for ( auto bfile : open_ttl_files_ ) {
for ( auto bfile : open_ttl_files_ ) {
@ -1475,7 +1476,7 @@ Status BlobDBImpl::GCFileAndUpdateLSM(const std::shared_ptr<BlobFile>& bfptr,
bfptr - > OpenRandomAccessReader ( env_ , db_options_ , env_options_ ) ;
bfptr - > OpenRandomAccessReader ( env_ , db_options_ , env_options_ ) ;
if ( ! reader ) {
if ( ! reader ) {
ROCKS_LOG_ERROR ( db_options_ . info_log ,
ROCKS_LOG_ERROR ( db_options_ . info_log ,
" File sequential reader could not be opened " ,
" File sequential reader could not be opened for %s " ,
bfptr - > PathName ( ) . c_str ( ) ) ;
bfptr - > PathName ( ) . c_str ( ) ) ;
return Status : : IOError ( " failed to create sequential reader " ) ;
return Status : : IOError ( " failed to create sequential reader " ) ;
}
}