1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-05-19 04:26:17 +08:00

Add probe::assert::rocksDB code probe annotation

This commit is contained in:
sfc-gh-tclinkenbeard 2022-09-15 11:48:04 -07:00
parent b19f1b5e3b
commit c0fd93869c
3 changed files with 15 additions and 2 deletions

@ -1461,7 +1461,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
break; break;
} }
case 4: { 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"); set_config("ssd-rocksdb-v1");
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB // Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
// background threads. // background threads.
@ -1471,7 +1471,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
break; break;
} }
case 5: { 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"); set_config("ssd-sharded-rocksdb");
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB // Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
// background threads. // background threads.

@ -288,6 +288,14 @@ bool SimOnly::operator()(ICodeProbe* self) const {
return g_network->isSimulated(); return g_network->isSimulated();
} }
bool RocksDB::operator()(ICodeProbe* self) const {
#ifdef SSD_ROCKSDB_EXPERIMENTAL
return true;
#else
return false;
#endif
}
} // namespace assert } // namespace assert
} // namespace probe } // namespace probe

@ -70,6 +70,10 @@ struct SimOnly {
constexpr static AnnotationType type = AnnotationType::Assertion; constexpr static AnnotationType type = AnnotationType::Assertion;
bool operator()(ICodeProbe* self) const; bool operator()(ICodeProbe* self) const;
}; };
struct RocksDB {
constexpr static AnnotationType type = AnnotationType::Assertion;
bool operator()(ICodeProbe* self) const;
};
template <class Left, class Right> template <class Left, class Right>
struct AssertOr { struct AssertOr {
@ -111,6 +115,7 @@ constexpr std::enable_if_t<T::type == AnnotationType::Assertion, AssertNot<T>> o
constexpr SimOnly simOnly; constexpr SimOnly simOnly;
constexpr auto noSim = !simOnly; constexpr auto noSim = !simOnly;
constexpr RocksDB rocksDB;
} // namespace assert } // namespace assert