rocksdb/db/db_impl
Wallace 1e9bf25f61 Do not hold mutex when write keys if not necessary (#7516)
Summary:
## Problem Summary
RocksDB will acquire the global mutex of db instance for every time when user calls `Write`.  When RocksDB schedules a lot of compaction jobs,   it will compete the mutex with write thread and it will hurt the write performance.

## Problem Solution:
I want to use log_write_mutex to replace the global mutex in most case so that we do not acquire it in write-thread unless there is a write-stall event or a write-buffer-full event occur.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7516

Test Plan:
1. make check
2. CI
3. COMPILE_WITH_TSAN=1 make db_stress
make crash_test
make crash_test_with_multiops_wp_txn
make crash_test_with_multiops_wc_txn
make crash_test_with_atomic_flush

Reviewed By: siying

Differential Revision: D36908702

Pulled By: riversand963

fbshipit-source-id: 59b13881f4f5c0a58fd3ca79128a396d9cd98efe
2022-07-21 13:35:36 -07:00
..
compacted_db_impl.cc Return "invalid argument" when read timestamp is too old (#10109) 2022-06-06 14:36:22 -07:00
compacted_db_impl.h Add API for writing wide-column entities (#10242) 2022-06-25 15:30:47 -07:00
db_impl.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl.h Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl_compaction_flush.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl_debug.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl_experimental.cc
db_impl_files.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl_open.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00
db_impl_readonly.cc Return "invalid argument" when read timestamp is too old (#10109) 2022-06-06 14:36:22 -07:00
db_impl_readonly.h Add API for writing wide-column entities (#10242) 2022-06-25 15:30:47 -07:00
db_impl_secondary.cc Update code comment and logging for secondary instance (#10260) 2022-07-05 10:09:44 -07:00
db_impl_secondary.h Update code comment and logging for secondary instance (#10260) 2022-07-05 10:09:44 -07:00
db_impl_write.cc Do not hold mutex when write keys if not necessary (#7516) 2022-07-21 13:35:36 -07:00