@ -22,6 +22,8 @@ WriteThread::WriteThread(const ImmutableDBOptions& db_options)
allow_concurrent_memtable_write_ (
allow_concurrent_memtable_write_ (
db_options . allow_concurrent_memtable_write ) ,
db_options . allow_concurrent_memtable_write ) ,
enable_pipelined_write_ ( db_options . enable_pipelined_write ) ,
enable_pipelined_write_ ( db_options . enable_pipelined_write ) ,
max_write_batch_group_size_bytes (
db_options . max_write_batch_group_size_bytes ) ,
newest_writer_ ( nullptr ) ,
newest_writer_ ( nullptr ) ,
newest_memtable_writer_ ( nullptr ) ,
newest_memtable_writer_ ( nullptr ) ,
last_sequence_ ( 0 ) ,
last_sequence_ ( 0 ) ,
@ -406,9 +408,10 @@ size_t WriteThread::EnterAsBatchGroupLeader(Writer* leader,
// Allow the group to grow up to a maximum size, but if the
// Allow the group to grow up to a maximum size, but if the
// original write is small, limit the growth so we do not slow
// original write is small, limit the growth so we do not slow
// down the small write too much.
// down the small write too much.
size_t max_size = 1 < < 20 ;
size_t max_size = max_write_batch_group_size_bytes ;
if ( size < = ( 128 < < 10 ) ) {
const uint64_t min_batch_size_bytes = max_write_batch_group_size_bytes / 8 ;
max_size = size + ( 128 < < 10 ) ;
if ( size < = min_batch_size_bytes ) {
max_size = size + min_batch_size_bytes ;
}
}
leader - > write_group = write_group ;
leader - > write_group = write_group ;
@ -485,9 +488,10 @@ void WriteThread::EnterAsMemTableWriter(Writer* leader,
// Allow the group to grow up to a maximum size, but if the
// Allow the group to grow up to a maximum size, but if the
// original write is small, limit the growth so we do not slow
// original write is small, limit the growth so we do not slow
// down the small write too much.
// down the small write too much.
size_t max_size = 1 < < 20 ;
size_t max_size = max_write_batch_group_size_bytes ;
if ( size < = ( 128 < < 10 ) ) {
const uint64_t min_batch_size_bytes = max_write_batch_group_size_bytes / 8 ;
max_size = size + ( 128 < < 10 ) ;
if ( size < = min_batch_size_bytes ) {
max_size = size + min_batch_size_bytes ;
}
}
leader - > write_group = write_group ;
leader - > write_group = write_group ;