@ -731,9 +731,8 @@ void DBImpl::PurgeObsoleteFiles(DeletionState& state) {
fname . c_str ( ) , archived_log_name . c_str ( ) , s . ToString ( ) . c_str ( ) ) ;
fname . c_str ( ) , archived_log_name . c_str ( ) , s . ToString ( ) . c_str ( ) ) ;
} else {
} else {
Status s = env_ - > DeleteFile ( fname ) ;
Status s = env_ - > DeleteFile ( fname ) ;
Log ( options_ . info_log , " Delete %s type=%d #%lu -- %s \n " ,
Log ( options_ . info_log , " Delete %s type=%d #% " PRIu64 " -- %s \n " ,
fname . c_str ( ) , type , ( unsigned long ) number ,
fname . c_str ( ) , type , number , s . ToString ( ) . c_str ( ) ) ;
s . ToString ( ) . c_str ( ) ) ;
}
}
}
}
@ -1257,8 +1256,7 @@ Status DBImpl::RecoverLogFile(uint64_t log_number, SequenceNumber* max_sequence,
// large sequence numbers).
// large sequence numbers).
log : : Reader reader ( std : : move ( file ) , & reporter , true /*checksum*/ ,
log : : Reader reader ( std : : move ( file ) , & reporter , true /*checksum*/ ,
0 /*initial_offset*/ ) ;
0 /*initial_offset*/ ) ;
Log ( options_ . info_log , " Recovering log #%lu " ,
Log ( options_ . info_log , " Recovering log #% " PRIu64 " " , log_number ) ;
( unsigned long ) log_number ) ;
// Read all the records and add to a memtable
// Read all the records and add to a memtable
std : : string scratch ;
std : : string scratch ;
@ -1375,8 +1373,8 @@ Status DBImpl::WriteLevel0TableForRecovery(ColumnFamilyData* cfd, MemTable* mem,
const SequenceNumber newest_snapshot = snapshots_ . GetNewest ( ) ;
const SequenceNumber newest_snapshot = snapshots_ . GetNewest ( ) ;
const SequenceNumber earliest_seqno_in_memtable =
const SequenceNumber earliest_seqno_in_memtable =
mem - > GetFirstSequenceNumber ( ) ;
mem - > GetFirstSequenceNumber ( ) ;
Log ( options_ . info_log , " [%s] Level-0 table #%l u: started " ,
Log ( options_ . info_log , " [%s] Level-0 table #% " PRI u64 " : started " ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) meta . fd . GetNumber ( ) ) ;
cfd - > GetName ( ) . c_str ( ) , meta . fd . GetNumber ( ) ) ;
Status s ;
Status s ;
{
{
@ -1389,9 +1387,10 @@ Status DBImpl::WriteLevel0TableForRecovery(ColumnFamilyData* cfd, MemTable* mem,
mutex_ . Lock ( ) ;
mutex_ . Lock ( ) ;
}
}
Log ( options_ . info_log , " [%s] Level-0 table #%lu: %lu bytes %s " ,
Log ( options_ . info_log ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) meta . fd . GetNumber ( ) ,
" [%s] Level-0 table #% " PRIu64 " : % " PRIu64 " bytes %s " ,
( unsigned long ) meta . fd . GetFileSize ( ) , s . ToString ( ) . c_str ( ) ) ;
cfd - > GetName ( ) . c_str ( ) , meta . fd . GetNumber ( ) , meta . fd . GetFileSize ( ) ,
s . ToString ( ) . c_str ( ) ) ;
delete iter ;
delete iter ;
pending_outputs_ . erase ( meta . fd . GetNumber ( ) ) ;
pending_outputs_ . erase ( meta . fd . GetNumber ( ) ) ;
@ -1436,14 +1435,15 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd,
log_buffer - > FlushBufferToLog ( ) ;
log_buffer - > FlushBufferToLog ( ) ;
std : : vector < Iterator * > memtables ;
std : : vector < Iterator * > memtables ;
for ( MemTable * m : mems ) {
for ( MemTable * m : mems ) {
Log ( options_ . info_log , " [%s] Flushing memtable with next log file: %lu \n " ,
Log ( options_ . info_log ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) m - > GetNextLogNumber ( ) ) ;
" [%s] Flushing memtable with next log file: % " PRIu64 " \n " ,
cfd - > GetName ( ) . c_str ( ) , m - > GetNextLogNumber ( ) ) ;
memtables . push_back ( m - > NewIterator ( ReadOptions ( ) , true ) ) ;
memtables . push_back ( m - > NewIterator ( ReadOptions ( ) , true ) ) ;
}
}
Iterator * iter = NewMergingIterator ( & cfd - > internal_comparator ( ) ,
Iterator * iter = NewMergingIterator ( & cfd - > internal_comparator ( ) ,
& memtables [ 0 ] , memtables . size ( ) ) ;
& memtables [ 0 ] , memtables . size ( ) ) ;
Log ( options_ . info_log , " [%s] Level-0 flush table #%l u: started " ,
Log ( options_ . info_log , " [%s] Level-0 flush table #% " PRI u64 " : started " ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) meta . fd . GetNumber ( ) ) ;
cfd - > GetName ( ) . c_str ( ) , meta . fd . GetNumber ( ) ) ;
s = BuildTable ( dbname_ , env_ , * cfd - > options ( ) , storage_options_ ,
s = BuildTable ( dbname_ , env_ , * cfd - > options ( ) , storage_options_ ,
cfd - > table_cache ( ) , iter , & meta , cfd - > internal_comparator ( ) ,
cfd - > table_cache ( ) , iter , & meta , cfd - > internal_comparator ( ) ,
@ -1451,9 +1451,10 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd,
GetCompressionFlush ( * cfd - > options ( ) ) ) ;
GetCompressionFlush ( * cfd - > options ( ) ) ) ;
LogFlush ( options_ . info_log ) ;
LogFlush ( options_ . info_log ) ;
delete iter ;
delete iter ;
Log ( options_ . info_log , " [%s] Level-0 flush table #%lu: %lu bytes %s " ,
Log ( options_ . info_log ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) meta . fd . GetFileSize ( ) ,
" [%s] Level-0 flush table #% " PRIu64 " : % " PRIu64 " bytes %s " ,
( unsigned long ) meta . fd . GetFileSize ( ) , s . ToString ( ) . c_str ( ) ) ;
cfd - > GetName ( ) . c_str ( ) , meta . fd . GetFileSize ( ) , meta . fd . GetFileSize ( ) ,
s . ToString ( ) . c_str ( ) ) ;
if ( ! options_ . disableDataSync ) {
if ( ! options_ . disableDataSync ) {
db_directory_ - > Fsync ( ) ;
db_directory_ - > Fsync ( ) ;
@ -2402,9 +2403,10 @@ Status DBImpl::FinishCompactionOutputFile(CompactionState* compact,
s = iter - > status ( ) ;
s = iter - > status ( ) ;
delete iter ;
delete iter ;
if ( s . ok ( ) ) {
if ( s . ok ( ) ) {
Log ( options_ . info_log , " [%s] Generated table #%lu: %lu keys, %lu bytes " ,
Log ( options_ . info_log , " [%s] Generated table #% " PRIu64 " : % " PRIu64
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) output_number ,
" keys, % " PRIu64 " bytes " ,
( unsigned long ) current_entries , ( unsigned long ) current_bytes ) ;
cfd - > GetName ( ) . c_str ( ) , output_number , current_entries ,
current_bytes ) ;
}
}
}
}
return s ;
return s ;
@ -2469,9 +2471,8 @@ inline SequenceNumber DBImpl::findEarliestVisibleSnapshot(
assert ( prev ) ;
assert ( prev ) ;
}
}
Log ( options_ . info_log ,
Log ( options_ . info_log ,
" Looking for seqid %lu but maxseqid is %lu " ,
" Looking for seqid % " PRIu64 " but maxseqid is % " PRIu64 " " , in ,
( unsigned long ) in ,
snapshots [ snapshots . size ( ) - 1 ] ) ;
( unsigned long ) snapshots [ snapshots . size ( ) - 1 ] ) ;
assert ( 0 ) ;
assert ( 0 ) ;
return 0 ;
return 0 ;
}
}
@ -4169,8 +4170,9 @@ Status DBImpl::MakeRoomForWrite(
}
}
new_mem - > Ref ( ) ;
new_mem - > Ref ( ) ;
cfd - > SetMemtable ( new_mem ) ;
cfd - > SetMemtable ( new_mem ) ;
Log ( options_ . info_log , " [%s] New memtable created with log file: #%lu \n " ,
Log ( options_ . info_log ,
cfd - > GetName ( ) . c_str ( ) , ( unsigned long ) logfile_number_ ) ;
" [%s] New memtable created with log file: #% " PRIu64 " \n " ,
cfd - > GetName ( ) . c_str ( ) , logfile_number_ ) ;
force = false ; // Do not force another compaction if have room
force = false ; // Do not force another compaction if have room
MaybeScheduleFlushOrCompaction ( ) ;
MaybeScheduleFlushOrCompaction ( ) ;
superversions_to_free - > push_back (
superversions_to_free - > push_back (