Skip to content

Commit 35508f9

Browse files
authored
Merge pull request #10606 from gitbw95/7.6.1
Patch 7.6.1
2 parents 2f73550 + 87863f2 commit 35508f9

File tree

7 files changed

+44
-19
lines changed

7 files changed

+44
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ set(SOURCES
827827
util/slice.cc
828828
util/file_checksum_helper.cc
829829
util/status.cc
830+
util/stderr_logger.cc
830831
util/string_util.cc
831832
util/thread_local.cc
832833
util/threadpool_imp.cc

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Rocksdb Change Log
2+
## 7.6.1 (08/29/2022)
3+
### Bug Fixes
4+
* Fix a bug where `port/sys_time.h` cannot be imported for some build when it is included in `stderr_logger.h`.
5+
26
## 7.6.0 (08/19/2022)
37
### New Features
48
* 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.

TARGETS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ cpp_library_wrapper(name="rocksdb_lib", srcs=[
252252
"util/ribbon_config.cc",
253253
"util/slice.cc",
254254
"util/status.cc",
255+
"util/stderr_logger.cc",
255256
"util/string_util.cc",
256257
"util/thread_local.cc",
257258
"util/threadpool_imp.cc",
@@ -589,6 +590,7 @@ cpp_library_wrapper(name="rocksdb_whole_archive_lib", srcs=[
589590
"util/ribbon_config.cc",
590591
"util/slice.cc",
591592
"util/status.cc",
593+
"util/stderr_logger.cc",
592594
"util/string_util.cc",
593595
"util/thread_local.cc",
594596
"util/threadpool_imp.cc",

include/rocksdb/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// minor or major version number planned for release.
1414
#define ROCKSDB_MAJOR 7
1515
#define ROCKSDB_MINOR 6
16-
#define ROCKSDB_PATCH 0
16+
#define ROCKSDB_PATCH 1
1717

1818
// Do not use these. We made the mistake of declaring macros starting with
1919
// double underscore. Now we have to live with our choice. We'll deprecate these

src.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ LIB_SOURCES = \
239239
util/slice.cc \
240240
util/file_checksum_helper.cc \
241241
util/status.cc \
242+
util/stderr_logger.cc \
242243
util/string_util.cc \
243244
util/thread_local.cc \
244245
util/threadpool_imp.cc \

util/stderr_logger.cc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Meta Platforms, Inc. and affiliates.
2+
//
3+
// This source code is licensed under both the GPLv2 (found in the
4+
// COPYING file in the root directory) and Apache 2.0 License
5+
// (found in the LICENSE.Apache file in the root directory).
6+
7+
#include "util/stderr_logger.h"
8+
9+
#include "port/sys_time.h"
10+
11+
namespace ROCKSDB_NAMESPACE {
12+
StderrLogger::~StderrLogger() {}
13+
14+
void StderrLogger::Logv(const char* format, va_list ap) {
15+
const uint64_t thread_id = Env::Default()->GetThreadID();
16+
17+
port::TimeVal now_tv;
18+
port::GetTimeOfDay(&now_tv, nullptr);
19+
const time_t seconds = now_tv.tv_sec;
20+
struct tm t;
21+
port::LocalTimeR(&seconds, &t);
22+
fprintf(stderr, "%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx ", t.tm_year + 1900,
23+
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec,
24+
static_cast<int>(now_tv.tv_usec),
25+
static_cast<long long unsigned int>(thread_id));
26+
27+
vfprintf(stderr, format, ap);
28+
fprintf(stderr, "\n");
29+
}
30+
} // namespace ROCKSDB_NAMESPACE

util/stderr_logger.h

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
1+
// Copyright (c) Meta Platforms, Inc. and affiliates.
2+
//
23
// This source code is licensed under both the GPLv2 (found in the
34
// COPYING file in the root directory) and Apache 2.0 License
45
// (found in the LICENSE.Apache file in the root directory).
@@ -8,7 +9,6 @@
89
#include <stdarg.h>
910
#include <stdio.h>
1011

11-
#include "port/sys_time.h"
1212
#include "rocksdb/env.h"
1313

1414
namespace ROCKSDB_NAMESPACE {
@@ -19,26 +19,13 @@ class StderrLogger : public Logger {
1919
explicit StderrLogger(const InfoLogLevel log_level = InfoLogLevel::INFO_LEVEL)
2020
: Logger(log_level) {}
2121

22+
~StderrLogger() override;
23+
2224
// Brings overloaded Logv()s into scope so they're not hidden when we override
2325
// a subset of them.
2426
using Logger::Logv;
2527

26-
virtual void Logv(const char* format, va_list ap) override {
27-
const uint64_t thread_id = Env::Default()->GetThreadID();
28-
29-
port::TimeVal now_tv;
30-
port::GetTimeOfDay(&now_tv, nullptr);
31-
const time_t seconds = now_tv.tv_sec;
32-
struct tm t;
33-
port::LocalTimeR(&seconds, &t);
34-
fprintf(stderr, "%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx ",
35-
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min,
36-
t.tm_sec, static_cast<int>(now_tv.tv_usec),
37-
static_cast<long long unsigned int>(thread_id));
38-
39-
vfprintf(stderr, format, ap);
40-
fprintf(stderr, "\n");
41-
}
28+
virtual void Logv(const char* format, va_list ap) override;
4229
};
4330

4431
} // namespace ROCKSDB_NAMESPACE

0 commit comments

Comments
 (0)