Fault Injection Active/Deactivation - Edit TSS mode set_config

This commit is contained in:
Sajjad Rahnama 2021-07-26 10:41:17 -07:00
parent e04646e267
commit d36b5d62df
1 changed files with 2 additions and 2 deletions

View File

@ -1648,11 +1648,11 @@ void SimulationConfig::setTss(const TestConfig& testConfig) {
tssCount =
std::max(0, std::min(tssCount, (db.usableRegions * (machine_count / datacenters) - replication_type) / 2));
if (!testConfig.config.present() && tssCount > 0) {
if (!testConfig.config.present() && tssCount > 0 && faultInjectionActivated) {
std::string confStr = format("tss_count:=%d tss_storage_engine:=%d", tssCount, db.storageServerStoreType);
set_config(confStr);
double tssRandom = deterministicRandom()->random01();
if (tssRandom > 0.5 || !faultInjectionActivated) {
if (tssRandom > 0.5) {
// normal tss mode
g_simulator.tssMode = ISimulator::TSSMode::EnabledNormal;
} else if (tssRandom < 0.25 && !testConfig.isFirstTestInRestart) {