mirror of
https://github.com/facebook/rocksdb.git
synced 2026-10-23 08:09:02 +03:00
Summary: Solaris support was contributed by outside users starting withd78c6b28c(2016), and no project CI has ever run on Solaris. The last Solaris-motivated change wasc76688745(https://github.com/facebook/rocksdb/issues/4012, June 2018). Four months later,d6ec28870(https://github.com/facebook/rocksdb/issues/4226, 5.18) gave PerfContext a user-declared destructor while the Solaris-only definition was still `__thread PerfContext perf_context_`, which GCC rejects, so the Solaris build has not compiled since.fd00f39f9(https://github.com/facebook/rocksdb/issues/8117, 2021) then renamed that definition to `perf_context` while keeping `#define perf_context (*get_perf_context())` in perf_context_imp.h, so the definition expands to `thread_local PerfContext (*get_perf_context());`, an error still present today. The Solaris-only paths are dead and untestable, yet still attract new carve-outs. Because Solaris support is apparently unused and complicating things, this change removes all OS_SOLARIS / SunOS handling from the build (Make, CMake, build_detect_platform, INSTALL.md), the portability layer and Env (endianness, gethrtime, directio, stack trace), the perf_context macro and destructor carve-out, Solaris-only test workarounds and exclusions, and RocksJava's Environment.isSolaris() and Solaris JNI library naming. Not Solaris-specific and kept: SPARC unaligned-access handling in util/coding.h, sparc64 in Makefile machine lists (Linux/OpenBSD), and sparcv9 in RocksJava Environment.is64Bit(). Third-party sources are untouched. Pull Request resolved: https://github.com/facebook/rocksdb/pull/15449 Test Plan: On non-Solaris platforms every removed condition was either an OS_SOLARIS-only branch or a `!defined(OS_SOLARIS)` term that was always true, so the code compiled is unchanged and the CI matrix covers it. The Solaris breakage was confirmed by syntax-checking monitoring/perf_context.cc with -DOS_SOLARIS (GCC 11, stub sys/isa_defs.h) at each commit touching the perf_context files fromc31979205throughfd00f39f9: clean befored6ec28870, failing at every commit fromd6ec28870on. Reviewed By: archang19 Differential Revision: D126714985 Pulled By: pdillinger fbshipit-source-id: 40d22fcd5a462375c9d2c93f52407df651286ef7
87 lines
2.5 KiB
C++
87 lines
2.5 KiB
C++
// Copyright (c) 2011-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).
|
|
|
|
#include "test_util/sync_point.h"
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include "test_util/sync_point_impl.h"
|
|
|
|
std::vector<std::string> rocksdb_kill_exclude_prefixes;
|
|
|
|
#ifndef NDEBUG
|
|
namespace ROCKSDB_NAMESPACE {
|
|
|
|
SyncPoint* SyncPoint::GetInstance() {
|
|
static SyncPoint sync_point;
|
|
return &sync_point;
|
|
}
|
|
|
|
SyncPoint::SyncPoint() : impl_(new Data) {}
|
|
|
|
SyncPoint::~SyncPoint() { delete impl_; }
|
|
|
|
void SyncPoint::LoadDependency(const std::vector<SyncPointPair>& dependencies) {
|
|
impl_->LoadDependency(dependencies);
|
|
}
|
|
|
|
void SyncPoint::LoadDependencyAndMarkers(
|
|
const std::vector<SyncPointPair>& dependencies,
|
|
const std::vector<SyncPointPair>& markers) {
|
|
impl_->LoadDependencyAndMarkers(dependencies, markers);
|
|
}
|
|
|
|
void SyncPoint::SetCallBack(const std::string& point,
|
|
const std::function<void(void*)>& callback) {
|
|
impl_->SetCallBack(point, callback);
|
|
}
|
|
|
|
void SyncPoint::ClearCallBack(const std::string& point) {
|
|
impl_->ClearCallBack(point);
|
|
}
|
|
|
|
void SyncPoint::ClearAllCallBacks() { impl_->ClearAllCallBacks(); }
|
|
|
|
void SyncPoint::EnableProcessing() { impl_->EnableProcessing(); }
|
|
|
|
void SyncPoint::DisableProcessing() { impl_->DisableProcessing(); }
|
|
|
|
void SyncPoint::ClearTrace() { impl_->ClearTrace(); }
|
|
|
|
void SyncPoint::Process(const Slice& point, void* cb_arg) {
|
|
impl_->Process(point, cb_arg);
|
|
}
|
|
|
|
} // namespace ROCKSDB_NAMESPACE
|
|
#endif // NDEBUG
|
|
|
|
namespace ROCKSDB_NAMESPACE {
|
|
void SetupSyncPointsToMockDirectIO() {
|
|
#if !defined(NDEBUG) && !defined(OS_MACOSX) && !defined(OS_WIN) && \
|
|
!defined(OS_AIX) && !defined(OS_OPENBSD)
|
|
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack(
|
|
"NewWritableFile:O_DIRECT", [&](void* arg) {
|
|
int* val = static_cast<int*>(arg);
|
|
*val &= ~O_DIRECT;
|
|
});
|
|
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack(
|
|
"NewRandomAccessFile:O_DIRECT", [&](void* arg) {
|
|
int* val = static_cast<int*>(arg);
|
|
*val &= ~O_DIRECT;
|
|
});
|
|
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->SetCallBack(
|
|
"NewSequentialFile:O_DIRECT", [&](void* arg) {
|
|
int* val = static_cast<int*>(arg);
|
|
*val &= ~O_DIRECT;
|
|
});
|
|
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->EnableProcessing();
|
|
#endif
|
|
}
|
|
|
|
#ifndef NDEBUG
|
|
std::atomic<int> g_throw_on_testable_assertion_failure{0};
|
|
#endif // NDEBUG
|
|
} // namespace ROCKSDB_NAMESPACE
|