mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Add probe::assert::rocksDB code probe annotation
This commit is contained in:
parent
b19f1b5e3b
commit
c0fd93869c
@ -1461,7 +1461,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
CODE_PROBE(true, "Simulated cluster using RocksDB storage engine");
|
||||
CODE_PROBE(true, "Simulated cluster using RocksDB storage engine", probe::assert::rocksDB);
|
||||
set_config("ssd-rocksdb-v1");
|
||||
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
|
||||
// background threads.
|
||||
@ -1471,7 +1471,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
CODE_PROBE(true, "Simulated cluster using Sharded RocksDB storage engine");
|
||||
CODE_PROBE(true, "Simulated cluster using Sharded RocksDB storage engine", probe::assert::rocksDB);
|
||||
set_config("ssd-sharded-rocksdb");
|
||||
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
|
||||
// background threads.
|
||||
|
@ -288,6 +288,14 @@ bool SimOnly::operator()(ICodeProbe* self) const {
|
||||
return g_network->isSimulated();
|
||||
}
|
||||
|
||||
bool RocksDB::operator()(ICodeProbe* self) const {
|
||||
#ifdef SSD_ROCKSDB_EXPERIMENTAL
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace assert
|
||||
|
||||
} // namespace probe
|
||||
|
@ -70,6 +70,10 @@ struct SimOnly {
|
||||
constexpr static AnnotationType type = AnnotationType::Assertion;
|
||||
bool operator()(ICodeProbe* self) const;
|
||||
};
|
||||
struct RocksDB {
|
||||
constexpr static AnnotationType type = AnnotationType::Assertion;
|
||||
bool operator()(ICodeProbe* self) const;
|
||||
};
|
||||
|
||||
template <class Left, class Right>
|
||||
struct AssertOr {
|
||||
@ -111,6 +115,7 @@ constexpr std::enable_if_t<T::type == AnnotationType::Assertion, AssertNot<T>> o
|
||||
|
||||
constexpr SimOnly simOnly;
|
||||
constexpr auto noSim = !simOnly;
|
||||
constexpr RocksDB rocksDB;
|
||||
|
||||
} // namespace assert
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user