diff --git a/HISTORY.md b/HISTORY.md index 53bdd8e717..b87a3c1771 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,9 @@ * unit tests: fix GlobalWriteControllerTest.GlobalAndWBMSetupDelay by waiting for the memtable memory release. * spdb memtable: use_seek_parallel_threshold option parameter mishandled (#570) * build: Plug memtable global switch memtable stuck fix. (#606) +* build: Windows compilation fix (#568). +* Logger: fix Block cache stats trace by spacing it from the last trace (#578). +* WriteController: move the class to public interface which should have been done under #346. ## Fig v2.5.0 (06/14/2023) Based on RocksDB 8.1.1 diff --git a/db/column_family.cc b/db/column_family.cc index d78a9cb057..645d2e7d62 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -29,7 +29,6 @@ #include "db/range_del_aggregator.h" #include "db/table_properties_collector.h" #include "db/version_set.h" -#include "db/write_controller.h" #include "file/sst_file_manager_impl.h" #include "logging/logging.h" #include "monitoring/thread_status_util.h" @@ -37,6 +36,7 @@ #include "port/port.h" #include "rocksdb/convenience.h" #include "rocksdb/table.h" +#include "rocksdb/write_controller.h" #include "table/merging_iterator.h" #include "util/autovector.h" #include "util/cast_util.h" diff --git a/db/column_family.h b/db/column_family.h index d5ef1a1ab5..da26489442 100644 --- a/db/column_family.h +++ b/db/column_family.h @@ -19,12 +19,12 @@ #include "db/table_cache.h" #include "db/table_properties_collector.h" #include "db/write_batch_internal.h" -#include "db/write_controller.h" #include "options/cf_options.h" #include "rocksdb/compaction_job_stats.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/options.h" +#include "rocksdb/write_controller.h" #include "trace_replay/block_cache_tracer.h" #include "util/hash_containers.h" #include "util/thread_local.h" diff --git a/db/compaction/compaction_job.h b/db/compaction/compaction_job.h index a930c15f1f..aef1b3edf2 100644 --- a/db/compaction/compaction_job.h +++ b/db/compaction/compaction_job.h @@ -29,7 +29,6 @@ #include "db/range_del_aggregator.h" #include "db/seqno_to_time_mapping.h" #include "db/version_edit.h" -#include "db/write_controller.h" #include "db/write_thread.h" #include "logging/event_logger.h" #include "options/cf_options.h" @@ -41,6 +40,7 @@ #include "rocksdb/env.h" #include "rocksdb/memtablerep.h" #include "rocksdb/transaction_log.h" +#include "rocksdb/write_controller.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" #include "util/stop_watch.h" diff --git a/db/db_impl/db_impl.h b/db/db_impl/db_impl.h index d7c1f2e4a7..bb3534ba5d 100644 --- a/db/db_impl/db_impl.h +++ b/db/db_impl/db_impl.h @@ -45,7 +45,6 @@ #include "db/trim_history_scheduler.h" #include "db/version_edit.h" #include "db/wal_manager.h" -#include "db/write_controller.h" #include "db/write_thread.h" #include "logging/event_logger.h" #include "monitoring/instrumented_mutex.h" @@ -59,6 +58,7 @@ #include "rocksdb/transaction_log.h" #include "rocksdb/utilities/replayer.h" #include "rocksdb/write_buffer_manager.h" +#include "rocksdb/write_controller.h" #include "table/merging_iterator.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" diff --git a/db/flush_job.h b/db/flush_job.h index d3902f0bd0..7f1daeac05 100644 --- a/db/flush_job.h +++ b/db/flush_job.h @@ -28,7 +28,6 @@ #include "db/seqno_to_time_mapping.h" #include "db/snapshot_impl.h" #include "db/version_edit.h" -#include "db/write_controller.h" #include "db/write_thread.h" #include "logging/event_logger.h" #include "monitoring/instrumented_mutex.h" @@ -39,6 +38,7 @@ #include "rocksdb/listener.h" #include "rocksdb/memtablerep.h" #include "rocksdb/transaction_log.h" +#include "rocksdb/write_controller.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" #include "util/stop_watch.h" diff --git a/db/global_write_controller_test.cc b/db/global_write_controller_test.cc index 64ab9c1903..d5dd67e751 100644 --- a/db/global_write_controller_test.cc +++ b/db/global_write_controller_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "db/db_test_util.h" -#include "db/write_controller.h" #include "rocksdb/write_buffer_manager.h" +#include "rocksdb/write_controller.h" namespace ROCKSDB_NAMESPACE { diff --git a/db/memtable_list_test.cc b/db/memtable_list_test.cc index a809edd391..acb792a504 100644 --- a/db/memtable_list_test.cc +++ b/db/memtable_list_test.cc @@ -11,10 +11,10 @@ #include "db/merge_context.h" #include "db/version_set.h" -#include "db/write_controller.h" #include "rocksdb/db.h" #include "rocksdb/status.h" #include "rocksdb/write_buffer_manager.h" +#include "rocksdb/write_controller.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/string_util.h" diff --git a/db/version_set.h b/db/version_set.h index 0ffadb5c38..42b3a7a3da 100644 --- a/db/version_set.h +++ b/db/version_set.h @@ -45,8 +45,8 @@ #include "db/table_cache.h" #include "db/version_builder.h" #include "db/version_edit.h" -#include "db/write_controller.h" #include "env/file_system_tracer.h" +#include "rocksdb/write_controller.h" #if USE_COROUTINES #include "folly/experimental/coro/BlockingWait.h" #include "folly/experimental/coro/Collect.h" diff --git a/db/write_controller.cc b/db/write_controller.cc index 9677128fdf..ee0027319e 100644 --- a/db/write_controller.cc +++ b/db/write_controller.cc @@ -3,7 +3,7 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#include "db/write_controller.h" +#include "rocksdb/write_controller.h" #include #include diff --git a/db/write_controller_test.cc b/db/write_controller_test.cc index bd17b957db..83d1d49713 100644 --- a/db/write_controller_test.cc +++ b/db/write_controller_test.cc @@ -3,7 +3,7 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#include "db/write_controller.h" +#include "rocksdb/write_controller.h" #include #include diff --git a/db/write_controller.h b/include/rocksdb/write_controller.h similarity index 98% rename from db/write_controller.h rename to include/rocksdb/write_controller.h index 6db06407b3..22fc78703b 100644 --- a/db/write_controller.h +++ b/include/rocksdb/write_controller.h @@ -68,10 +68,13 @@ class WriteController { bool NeedSpeedupCompaction() const { return IsStopped() || NeedsDelay() || total_compaction_pressure_.load() > 0; } + + // Should only be called by Speedb internally! // return how many microseconds the caller needs to sleep after the call // num_bytes: how many number of bytes to put into the DB. // Prerequisite: DB mutex held. uint64_t GetDelay(SystemClock* clock, uint64_t num_bytes); + void set_delayed_write_rate(uint64_t write_rate) { std::lock_guard lock(metrics_mu_); // avoid divide 0 @@ -117,6 +120,7 @@ class WriteController { uint64_t TEST_GetMapMinRate(); + // Below 2 functions should only be called by Speedb internally! void WaitOnCV(std::function continue_wait); void NotifyCV();