mirror of https://github.com/facebook/rocksdb.git
44fd914128
Summary: Fixes https://github.com/facebook/rocksdb/issues/12061. We were double counting the `BYTES_WRITTEN` ticker when doing writes with transactions. During transactions, after writing, a client can call `Prepare()`, which writes the values to WAL but not to the Memtable. After that, they can call `Commit()`, which writes a commit marker to the WAL and the values to Memtable. The cause of this bug is previously during writes, we didn't take into account `writer->ShouldWriteToMemtable()` before adding to `total_byte_size`, so it is still added to during the `Prepare()` phase even though we're not writing to the Memtable, which was why we saw the value to be double of what's written to WAL. Pull Request resolved: https://github.com/facebook/rocksdb/pull/12111 Test Plan: Added a test in `db/db_statistics_test.cc` that tests writes with and without transactions, by comparing the values of `BYTES_WRITTEN` and `WAL_FILE_BYTES` after doing writes. Reviewed By: jaykorean Differential Revision: D51954327 Pulled By: jowlyzhang fbshipit-source-id: 57a0986a14e5b94eb5188715d819212529110d2c |
||
---|---|---|
.. | ||
file_read_sample.h | ||
histogram.cc | ||
histogram.h | ||
histogram_test.cc | ||
histogram_windowing.cc | ||
histogram_windowing.h | ||
in_memory_stats_history.cc | ||
in_memory_stats_history.h | ||
instrumented_mutex.cc | ||
instrumented_mutex.h | ||
iostats_context.cc | ||
iostats_context_imp.h | ||
iostats_context_test.cc | ||
perf_context.cc | ||
perf_context_imp.h | ||
perf_level.cc | ||
perf_level_imp.h | ||
perf_step_timer.h | ||
persistent_stats_history.cc | ||
persistent_stats_history.h | ||
statistics.cc | ||
statistics_impl.h | ||
statistics_test.cc | ||
stats_history_test.cc | ||
thread_status_impl.cc | ||
thread_status_updater.cc | ||
thread_status_updater.h | ||
thread_status_updater_debug.cc | ||
thread_status_util.cc | ||
thread_status_util.h | ||
thread_status_util_debug.cc |