remove allowDisablingTenants flag and add new downgrade test

This commit is contained in:
Jon Fu 2022-10-19 14:15:03 -07:00
parent 930801b483
commit 702fcd1274
18 changed files with 111 additions and 33 deletions

View File

@ -315,9 +315,6 @@ class TestConfig : public BasicTestConfig {
if (attrib == "allowDefaultTenant") { if (attrib == "allowDefaultTenant") {
allowDefaultTenant = strcmp(value.c_str(), "true") == 0; allowDefaultTenant = strcmp(value.c_str(), "true") == 0;
} }
if (attrib == "allowDisablingTenants") {
allowDisablingTenants = strcmp(value.c_str(), "true") == 0;
}
if (attrib == "allowCreatingTenants") { if (attrib == "allowCreatingTenants") {
allowCreatingTenants = strcmp(value.c_str(), "true") == 0; allowCreatingTenants = strcmp(value.c_str(), "true") == 0;
} }
@ -382,7 +379,6 @@ public:
bool randomlyRenameZoneId = false; bool randomlyRenameZoneId = false;
bool allowDefaultTenant = true; bool allowDefaultTenant = true;
bool allowDisablingTenants = true;
bool allowCreatingTenants = true; bool allowCreatingTenants = true;
bool injectTargetedSSRestart = false; bool injectTargetedSSRestart = false;
bool injectSSDelay = false; bool injectSSDelay = false;
@ -453,7 +449,6 @@ public:
.add("extraMachineCountDC", &extraMachineCountDC) .add("extraMachineCountDC", &extraMachineCountDC)
.add("blobGranulesEnabled", &blobGranulesEnabled) .add("blobGranulesEnabled", &blobGranulesEnabled)
.add("allowDefaultTenant", &allowDefaultTenant) .add("allowDefaultTenant", &allowDefaultTenant)
.add("allowDisablingTenants", &allowDisablingTenants)
.add("allowCreatingTenants", &allowCreatingTenants) .add("allowCreatingTenants", &allowCreatingTenants)
.add("randomlyRenameZoneId", &randomlyRenameZoneId) .add("randomlyRenameZoneId", &randomlyRenameZoneId)
.add("injectTargetedSSRestart", &injectTargetedSSRestart) .add("injectTargetedSSRestart", &injectTargetedSSRestart)
@ -2481,7 +2476,6 @@ ACTOR void setupAndRun(std::string dataFolder,
allowList.addTrustedSubnet("0.0.0.0/2"sv); allowList.addTrustedSubnet("0.0.0.0/2"sv);
allowList.addTrustedSubnet("abcd::/16"sv); allowList.addTrustedSubnet("abcd::/16"sv);
state bool allowDefaultTenant = testConfig.allowDefaultTenant; state bool allowDefaultTenant = testConfig.allowDefaultTenant;
state bool allowDisablingTenants = testConfig.allowDisablingTenants;
state bool allowCreatingTenants = testConfig.allowCreatingTenants; state bool allowCreatingTenants = testConfig.allowCreatingTenants;
if (!SERVER_KNOBS->SHARD_ENCODE_LOCATION_METADATA) { if (!SERVER_KNOBS->SHARD_ENCODE_LOCATION_METADATA) {
@ -2550,21 +2544,18 @@ ACTOR void setupAndRun(std::string dataFolder,
if (testConfig.tenantModes.size()) { if (testConfig.tenantModes.size()) {
auto randomPick = deterministicRandom()->randomChoice(testConfig.tenantModes); auto randomPick = deterministicRandom()->randomChoice(testConfig.tenantModes);
tenantMode = TenantMode::fromValue(StringRef(std::to_string(randomPick))); tenantMode = TenantMode::fromValue(StringRef(std::to_string(randomPick)));
if (tenantMode == TenantMode::REQUIRED) { if (allowDefaultTenant) {
allowDefaultTenant = true;
defaultTenant = "SimulatedDefaultTenant"_sr; defaultTenant = "SimulatedDefaultTenant"_sr;
} }
} else { } else if (allowDefaultTenant && deterministicRandom()->random01() < 0.5) {
if (allowDefaultTenant && deterministicRandom()->random01() < 0.5) { defaultTenant = "SimulatedDefaultTenant"_sr;
defaultTenant = "SimulatedDefaultTenant"_sr; if (deterministicRandom()->random01() < 0.9) {
if (deterministicRandom()->random01() < 0.9) { tenantMode = TenantMode::REQUIRED;
tenantMode = TenantMode::REQUIRED; } else {
} else {
tenantMode = TenantMode::OPTIONAL_TENANT;
}
} else if (!allowDisablingTenants || deterministicRandom()->random01() < 0.5) {
tenantMode = TenantMode::OPTIONAL_TENANT; tenantMode = TenantMode::OPTIONAL_TENANT;
} }
} else if (deterministicRandom()->random01() < 0.5) {
tenantMode = TenantMode::OPTIONAL_TENANT;
} }
} }
@ -2620,7 +2611,7 @@ ACTOR void setupAndRun(std::string dataFolder,
} }
TraceEvent("SimulatedClusterTenantMode") TraceEvent("SimulatedClusterTenantMode")
.detail("UsingTenant", defaultTenant) .detail("UsingTenant", defaultTenant)
.detail("TenantRequired", tenantMode.toString()) .detail("TenantMode", tenantMode.toString())
.detail("TotalTenants", tenantsToCreate.size()); .detail("TotalTenants", tenantsToCreate.size());
std::string clusterFileDir = joinPath(dataFolder, deterministicRandom()->randomUniqueID().toString()); std::string clusterFileDir = joinPath(dataFolder, deterministicRandom()->randomUniqueID().toString());
platform::createDirectory(clusterFileDir); platform::createDirectory(clusterFileDir);

View File

@ -306,6 +306,9 @@ if(WITH_PYTHON)
add_fdb_test( add_fdb_test(
TEST_FILES restarting/from_7.2.0/DrUpgradeRestart-1.txt TEST_FILES restarting/from_7.2.0/DrUpgradeRestart-1.txt
restarting/from_7.2.0/DrUpgradeRestart-2.txt) restarting/from_7.2.0/DrUpgradeRestart-2.txt)
add_fdb_test(
TEST_FILES restarting/to_7.2.0/CycleTestRestart-1.toml
restarting/to_7.2.0/CycleTestRestart-2.toml)
add_fdb_test(TEST_FILES slow/ApiCorrectness.toml) add_fdb_test(TEST_FILES slow/ApiCorrectness.toml)

View File

@ -1,6 +1,5 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = true
allowDisablingTenants = false
tenantModes = [2] tenantModes = [2]
[[knobs]] [[knobs]]

View File

@ -1,7 +1,7 @@
[configuration] [configuration]
StderrSeverity = 30 StderrSeverity = 30
allowDisablingTenants = false
allowDefaultTenant = false allowDefaultTenant = false
tenantModes = [1]
[[test]] [[test]]
testTitle = 'FuzzApiCorrectness' testTitle = 'FuzzApiCorrectness'

View File

@ -1,7 +1,7 @@
[configuration] [configuration]
StderrSeverity = 30 StderrSeverity = 30
allowDisablingTenants = false
allowDefaultTenant = false allowDefaultTenant = false
tenantModes = [1]
[[test]] [[test]]
testTitle = 'FuzzApiCorrectness' testTitle = 'FuzzApiCorrectness'

View File

@ -1,5 +1,5 @@
[configuration] [configuration]
allowDisablingTenants = false tenantModes = [1]
[[test]] [[test]]
testTitle = 'SpecialKeySpaceCorrectnessTest' testTitle = 'SpecialKeySpaceCorrectnessTest'

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
[[test]] [[test]]
testTitle = 'TenantCreation' testTitle = 'TenantCreation'

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
[[knobs]] [[knobs]]
allow_tokenless_tenant_access = true allow_tokenless_tenant_access = true

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
[[test]] [[test]]
testTitle = 'TenantEntryCacheTest' testTitle = 'TenantEntryCacheTest'

View File

@ -0,0 +1,49 @@
[configuration]
storageEngineExcludeTypes = [3]
maxTLogVersion = 6
disableTss = true
disableHostname = true
disableEncryption = true
[[knobs]]
# This can be removed once the lower bound of this downgrade test is a version that understands the new protocol
shard_encode_location_metadata = false
[[test]]
testTitle = 'Clogged'
clearAfterTest = false
[[test.workload]]
testName = 'Cycle'
transactionsPerSecond = 500.0
nodeCount = 2500
testDuration = 10.0
expectedRate = 0
[[test.workload]]
testName = 'RandomClogging'
testDuration = 10.0
[[test.workload]]
testName = 'Rollback'
meanDelay = 10.0
testDuration = 10.0
[[test.workload]]
testName = 'Attrition'
machinesToKill = 10
machinesToLeave = 3
reboot = true
testDuration = 10.0
[[test.workload]]
testName = 'Attrition'
machinesToKill = 10
machinesToLeave = 3
reboot = true
testDuration = 10.0
[[test.workload]]
testName = 'SaveAndKill'
restartInfoLocation = 'simfdb/restartInfo.ini'
testDuration = 10.0

View File

@ -0,0 +1,36 @@
[configuration]
maxTLogVersion = 6
disableTss = true
[[test]]
testTitle = 'Clogged'
runSetup = false
[[test.workload]]
testName = 'Cycle'
transactionsPerSecond = 2500.0
nodeCount = 2500
testDuration = 10.0
expectedRate = 0
[[test.workload]]
testName = 'RandomClogging'
testDuration = 10.0
[[test.workload]]
testName = 'Rollback'
meanDelay = 10.0
testDuration = 10.0
[[test.workload]]
testName = 'Attrition'
machinesToKill = 10
machinesToLeave = 3
reboot = true
testDuration = 10.0
[[test.workload]]
testName = 'Attrition'
machinesToKill = 10
machinesToLeave = 3
reboot = true

View File

@ -1,7 +1,7 @@
[configuration] [configuration]
blobGranulesEnabled = true blobGranulesEnabled = true
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
injectTargetedSSRestart = true injectTargetedSSRestart = true
injectSSDelay = true injectSSDelay = true
# FIXME: re-enable rocks at some point # FIXME: re-enable rocks at some point

View File

@ -1,7 +1,7 @@
[configuration] [configuration]
blobGranulesEnabled = true blobGranulesEnabled = true
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
# FIXME: re-enable rocks at some point # FIXME: re-enable rocks at some point
storageEngineExcludeTypes = [4, 5] storageEngineExcludeTypes = [4, 5]

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
allowCreatingTenants = false allowCreatingTenants = false
extraDatabaseMode = 'Multiple' extraDatabaseMode = 'Multiple'
extraDatabaseCount = 5 extraDatabaseCount = 5

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
[[test]] [[test]]
testTitle = 'TenantManagementTest' testTitle = 'TenantManagementTest'

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
allowCreatingTenants = false allowCreatingTenants = false
extraDatabaseMode = 'Single' extraDatabaseMode = 'Single'

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
allowCreatingTenants = false allowCreatingTenants = false
extraDatabaseMode = 'Single' extraDatabaseMode = 'Single'

View File

@ -1,6 +1,6 @@
[configuration] [configuration]
allowDefaultTenant = false allowDefaultTenant = false
allowDisablingTenants = false tenantModes = [1]
allowCreatingTenants = false allowCreatingTenants = false
extraDatabaseMode = 'Single' extraDatabaseMode = 'Single'