diff --git a/CMakeLists.txt b/CMakeLists.txt index c6ae7969b1b..bb65a9d8b9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -827,7 +827,6 @@ set(SOURCES util/slice.cc util/file_checksum_helper.cc util/status.cc - util/stderr_logger.cc util/string_util.cc util/thread_local.cc util/threadpool_imp.cc diff --git a/HISTORY.md b/HISTORY.md index 382dd251cec..114de442160 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,8 +1,4 @@ # Rocksdb Change Log -## 7.6.1 (08/29/2022) -### Bug Fixes -* Fix a bug where `port/sys_time.h` cannot be imported for some build when it is included in `stderr_logger.h`. - ## 7.6.0 (08/19/2022) ### New Features * Added `prepopulate_blob_cache` to ColumnFamilyOptions. If enabled, prepopulate warm/hot blobs which are already in memory into blob cache at the time of flush. On a flush, the blob that is in memory (in memtables) get flushed to the device. If using Direct IO, additional IO is incurred to read this blob back into memory again, which is avoided by enabling this option. This further helps if the workload exhibits high temporal locality, where most of the reads go to recently written data. This also helps in case of the remote file system since it involves network traffic and higher latencies. diff --git a/TARGETS b/TARGETS index 489d5c2362a..9f51dfa92d6 100644 --- a/TARGETS +++ b/TARGETS @@ -252,7 +252,6 @@ cpp_library_wrapper(name="rocksdb_lib", srcs=[ "util/ribbon_config.cc", "util/slice.cc", "util/status.cc", - "util/stderr_logger.cc", "util/string_util.cc", "util/thread_local.cc", "util/threadpool_imp.cc", @@ -590,7 +589,6 @@ cpp_library_wrapper(name="rocksdb_whole_archive_lib", srcs=[ "util/ribbon_config.cc", "util/slice.cc", "util/status.cc", - "util/stderr_logger.cc", "util/string_util.cc", "util/thread_local.cc", "util/threadpool_imp.cc", diff --git a/include/rocksdb/version.h b/include/rocksdb/version.h index 15716edeb5d..41ea925f027 100644 --- a/include/rocksdb/version.h +++ b/include/rocksdb/version.h @@ -13,7 +13,7 @@ // minor or major version number planned for release. #define ROCKSDB_MAJOR 7 #define ROCKSDB_MINOR 6 -#define ROCKSDB_PATCH 1 +#define ROCKSDB_PATCH 0 // Do not use these. We made the mistake of declaring macros starting with // double underscore. Now we have to live with our choice. We'll deprecate these diff --git a/src.mk b/src.mk index 9f670c346a5..c6dad4f0002 100644 --- a/src.mk +++ b/src.mk @@ -239,7 +239,6 @@ LIB_SOURCES = \ util/slice.cc \ util/file_checksum_helper.cc \ util/status.cc \ - util/stderr_logger.cc \ util/string_util.cc \ util/thread_local.cc \ util/threadpool_imp.cc \ diff --git a/util/stderr_logger.cc b/util/stderr_logger.cc deleted file mode 100644 index 6044b8b9367..00000000000 --- a/util/stderr_logger.cc +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Meta Platforms, Inc. and affiliates. -// -// This source code is licensed under both the GPLv2 (found in the -// COPYING file in the root directory) and Apache 2.0 License -// (found in the LICENSE.Apache file in the root directory). - -#include "util/stderr_logger.h" - -#include "port/sys_time.h" - -namespace ROCKSDB_NAMESPACE { -StderrLogger::~StderrLogger() {} - -void StderrLogger::Logv(const char* format, va_list ap) { - const uint64_t thread_id = Env::Default()->GetThreadID(); - - port::TimeVal now_tv; - port::GetTimeOfDay(&now_tv, nullptr); - const time_t seconds = now_tv.tv_sec; - struct tm t; - port::LocalTimeR(&seconds, &t); - fprintf(stderr, "%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx ", t.tm_year + 1900, - t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, - static_cast(now_tv.tv_usec), - static_cast(thread_id)); - - vfprintf(stderr, format, ap); - fprintf(stderr, "\n"); -} -} // namespace ROCKSDB_NAMESPACE diff --git a/util/stderr_logger.h b/util/stderr_logger.h index c3b01210cea..97bd6256184 100644 --- a/util/stderr_logger.h +++ b/util/stderr_logger.h @@ -1,5 +1,4 @@ -// Copyright (c) Meta Platforms, Inc. and affiliates. -// +// Copyright (c) 2016-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). @@ -9,6 +8,7 @@ #include #include +#include "port/sys_time.h" #include "rocksdb/env.h" namespace ROCKSDB_NAMESPACE { @@ -19,13 +19,26 @@ class StderrLogger : public Logger { explicit StderrLogger(const InfoLogLevel log_level = InfoLogLevel::INFO_LEVEL) : Logger(log_level) {} - ~StderrLogger() override; - // Brings overloaded Logv()s into scope so they're not hidden when we override // a subset of them. using Logger::Logv; - virtual void Logv(const char* format, va_list ap) override; + virtual void Logv(const char* format, va_list ap) override { + const uint64_t thread_id = Env::Default()->GetThreadID(); + + port::TimeVal now_tv; + port::GetTimeOfDay(&now_tv, nullptr); + const time_t seconds = now_tv.tv_sec; + struct tm t; + port::LocalTimeR(&seconds, &t); + fprintf(stderr, "%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx ", + t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, + t.tm_sec, static_cast(now_tv.tv_usec), + static_cast(thread_id)); + + vfprintf(stderr, format, ap); + fprintf(stderr, "\n"); + } }; } // namespace ROCKSDB_NAMESPACE