Changed code flow to fix loophole that avoided the knob guarding higher protocol versions and also added new restarting tests

This commit is contained in:
Jon Fu 2021-03-15 17:36:13 -04:00
parent a82d6cf7d4
commit 29c626ca6a
4 changed files with 73 additions and 10 deletions

View File

@ -1232,23 +1232,27 @@ void seedShardServers(Arena& arena, CommitTransactionRef& tr, vector<StorageServ
tr.read_snapshot = 0;
tr.read_conflict_ranges.push_back_deep(arena, allKeys);
for (int s = 0; s < servers.size(); s++) {
tr.set(arena, serverTagKeyFor(servers[s].id()), serverTagValue(server_tag[servers[s].id()]));
tr.set(arena, serverListKeyFor(servers[s].id()), serverListValue(servers[s]));
for (auto& s : servers) {
tr.set(arena, serverTagKeyFor(s.id()), serverTagValue(server_tag[s.id()]));
tr.set(arena, serverListKeyFor(s.id()), serverListValue(s));
}
std::vector<Tag> serverTags;
std::vector<UID> serverSrcUID;
serverTags.reserve(servers.size());
for (int i = 0; i < servers.size(); i++)
serverTags.push_back(server_tag[servers[i].id()]);
for (auto& s : servers) {
serverTags.push_back(server_tag[s.id()]);
serverSrcUID.push_back(s.id());
}
auto ksValue = CLIENT_KNOBS->TAG_ENCODE_KEY_SERVERS ? keyServersValue(serverTags)
: keyServersValue(Standalone<RangeResultRef>(), serverSrcUID);
// We have to set this range in two blocks, because the master tracking of "keyServersLocations" depends on a change
// to a specific
// key (keyServersKeyServersKey)
krmSetPreviouslyEmptyRange(
tr, arena, keyServersPrefix, KeyRangeRef(KeyRef(), allKeys.end), keyServersValue(serverTags), Value());
krmSetPreviouslyEmptyRange(tr, arena, keyServersPrefix, KeyRangeRef(KeyRef(), allKeys.end), ksValue, Value());
for (int s = 0; s < servers.size(); s++)
krmSetPreviouslyEmptyRange(
tr, arena, serverKeysPrefixFor(servers[s].id()), allKeys, serverKeysTrue, serverKeysFalse);
for (auto& s : servers) {
krmSetPreviouslyEmptyRange(tr, arena, serverKeysPrefixFor(s.id()), allKeys, serverKeysTrue, serverKeysFalse);
}
}

View File

@ -204,6 +204,9 @@ if(WITH_PYTHON)
add_fdb_test(
TEST_FILES restarting/from_7.0.0/UpgradeAndBackupRestore-1.toml
restarting/from_7.0.0/UpgradeAndBackupRestore-2.toml)
add_fdb_test(
TEST_FILES restarting/to_6.2.33/CycleTestRestart-1.txt
restarting/to_6.2.33/CycleTestRestart-2.txt IGNORE)
add_fdb_test(
TEST_FILES restarting/to_6.3.10/CycleTestRestart-1.txt
restarting/to_6.3.10/CycleTestRestart-2.txt)

View File

@ -0,0 +1,30 @@
testTitle=Clogged
clearAfterTest=false
testName=Cycle
transactionsPerSecond=500.0
nodeCount=2500
testDuration=10.0
expectedRate=0
testName=RandomClogging
testDuration=10.0
testName=Rollback
meanDelay=10.0
testDuration=10.0
testName=Attrition
machinesToKill=10
machinesToLeave=3
reboot=true
testDuration=10.0
testName=Attrition
machinesToKill=10
machinesToLeave=3
reboot=true
testDuration=10.0
testName=SaveAndKill
restartInfoLocation=simfdb/restartInfo.ini
testDuration=10.0

View File

@ -0,0 +1,26 @@
testTitle=Clogged
runSetup=false
testName=Cycle
transactionsPerSecond=2500.0
nodeCount=2500
testDuration=10.0
expectedRate=0
testName=RandomClogging
testDuration=10.0
testName=Rollback
meanDelay=10.0
testDuration=10.0
testName=Attrition
machinesToKill=10
machinesToLeave=3
reboot=true
testDuration=10.0
testName=Attrition
machinesToKill=10
machinesToLeave=3
reboot=true
testDuration=10.0