mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 07:30:54 +00:00
499ebb3ab5
Summary: Throughput: 46k tps in our sysbench settings (filling the details later) The idea is to have the simplest change that gives us a reasonable boost in 2PC throughput. Major design changes: 1. The WAL file internal buffer is not flushed after each write. Instead it is flushed before critical operations (WAL copy via fs) or when FlushWAL is called by MySQL. Flushing the WAL buffer is also protected via mutex_. 2. Use two sequence numbers: last seq, and last seq for write. Last seq is the last visible sequence number for reads. Last seq for write is the next sequence number that should be used to write to WAL/memtable. This allows to have a memtable write be in parallel to WAL writes. 3. BatchGroup is not used for writes. This means that we can have parallel writers which changes a major assumption in the code base. To accommodate for that i) allow only 1 WriteImpl that intends to write to memtable via mem_mutex_--which is fine since in 2PC almost all of the memtable writes come via group commit phase which is serial anyway, ii) make all the parts in the code base that assumed to be the only writer (via EnterUnbatched) to also acquire mem_mutex_, iii) stat updates are protected via a stat_mutex_. Note: the first commit has the approach figured out but is not clean. Submitting the PR anyway to get the early feedback on the approach. If we are ok with the approach I will go ahead with this updates: 0) Rebase with Yi's pipelining changes 1) Currently batching is disabled by default to make sure that it will be consistent with all unit tests. Will make this optional via a config. 2) A couple of unit tests are disabled. They need to be updated with the serial commit of 2PC taken into account. 3) Replacing BatchGroup with mem_mutex_ got a bit ugly as it requires releasing mutex_ beforehand (the same way EnterUnbatched does). This needs to be cleaned up. Closes https://github.com/facebook/rocksdb/pull/2345 Differential Revision: D5210732 Pulled By: maysamyabandeh fbshipit-source-id: 78653bd95a35cd1e831e555e0e57bdfd695355a4 |
||
---|---|---|
.. | ||
aligned_buffer.h | ||
allocator.h | ||
arena.cc | ||
arena.h | ||
arena_test.cc | ||
auto_roll_logger.cc | ||
auto_roll_logger.h | ||
auto_roll_logger_test.cc | ||
autovector.h | ||
autovector_test.cc | ||
bloom.cc | ||
bloom_test.cc | ||
build_version.cc.in | ||
build_version.h | ||
channel.h | ||
coding.cc | ||
coding.h | ||
coding_test.cc | ||
compaction_job_stats_impl.cc | ||
comparator.cc | ||
compression.h | ||
concurrent_arena.cc | ||
concurrent_arena.h | ||
core_local.h | ||
crc32c.cc | ||
crc32c.h | ||
crc32c_test.cc | ||
delete_scheduler.cc | ||
delete_scheduler.h | ||
delete_scheduler_test.cc | ||
dynamic_bloom.cc | ||
dynamic_bloom.h | ||
dynamic_bloom_test.cc | ||
event_logger.cc | ||
event_logger.h | ||
event_logger_test.cc | ||
fault_injection_test_env.cc | ||
fault_injection_test_env.h | ||
file_reader_writer.cc | ||
file_reader_writer.h | ||
file_reader_writer_test.cc | ||
file_util.cc | ||
file_util.h | ||
filelock_test.cc | ||
filename.cc | ||
filename.h | ||
filter_policy.cc | ||
hash.cc | ||
hash.h | ||
hash_map.h | ||
heap.h | ||
heap_test.cc | ||
kv_map.h | ||
log_buffer.cc | ||
log_buffer.h | ||
log_write_bench.cc | ||
logging.h | ||
memory_usage.h | ||
mpsc.h | ||
murmurhash.cc | ||
murmurhash.h | ||
mutexlock.h | ||
random.cc | ||
random.h | ||
rate_limiter.cc | ||
rate_limiter.h | ||
rate_limiter_test.cc | ||
slice.cc | ||
slice_transform_test.cc | ||
sst_file_manager_impl.cc | ||
sst_file_manager_impl.h | ||
status.cc | ||
status_message.cc | ||
stderr_logger.h | ||
stop_watch.h | ||
string_util.cc | ||
string_util.h | ||
sync_point.cc | ||
sync_point.h | ||
testharness.cc | ||
testharness.h | ||
testutil.cc | ||
testutil.h | ||
thread_list_test.cc | ||
thread_local.cc | ||
thread_local.h | ||
thread_local_test.cc | ||
thread_operation.h | ||
threadpool_imp.cc | ||
threadpool_imp.h | ||
timer_queue.h | ||
timer_queue_test.cc | ||
transaction_test_util.cc | ||
transaction_test_util.h | ||
xxhash.cc | ||
xxhash.h |