mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
Merge pull request #7491 from sfc-gh-xwang/bug/remotekv
Make g_simulator.datacenterDead() don't take spawn KV process into account
This commit is contained in:
commit
c9366f8b01
@ -107,6 +107,10 @@ public:
|
||||
|
||||
Future<KillType> onShutdown() { return shutdownSignal.getFuture(); }
|
||||
|
||||
bool isSpawnedKVProcess() const {
|
||||
// SOMEDAY: use a separate bool may be better?
|
||||
return name == "remote flow process";
|
||||
}
|
||||
bool isReliable() const {
|
||||
return !failed && fault_injection_p1 == 0 && fault_injection_p2 == 0 && !failedDisk &&
|
||||
(!machine || (machine->machineProcess->fault_injection_p1 == 0 &&
|
||||
|
@ -1328,7 +1328,8 @@ public:
|
||||
std::vector<LocalityData> primaryLocalitiesDead, primaryLocalitiesLeft;
|
||||
|
||||
for (auto processInfo : getAllProcesses()) {
|
||||
if (processInfo->isAvailableClass() && processInfo->locality.dcId() == dcId) {
|
||||
if (!processInfo->isSpawnedKVProcess() && processInfo->isAvailableClass() &&
|
||||
processInfo->locality.dcId() == dcId) {
|
||||
if (processInfo->isExcluded() || processInfo->isCleared() || !processInfo->isAvailable()) {
|
||||
primaryProcessesDead.add(processInfo->locality);
|
||||
primaryLocalitiesDead.push_back(processInfo->locality);
|
||||
@ -1348,7 +1349,6 @@ public:
|
||||
if (usableRegions > 1 && remoteTLogPolicy && !primaryTLogsDead) {
|
||||
primaryTLogsDead = primaryProcessesDead.validate(remoteTLogPolicy);
|
||||
}
|
||||
|
||||
return primaryTLogsDead || primaryProcessesDead.validate(storagePolicy);
|
||||
}
|
||||
|
||||
@ -1602,7 +1602,7 @@ public:
|
||||
.detail("Protected", protectedAddresses.count(machine->address))
|
||||
.backtrace();
|
||||
// This will remove all the "tracked" messages that came from the machine being killed
|
||||
if (machine->name != "remote flow process")
|
||||
if (!machine->isSpawnedKVProcess())
|
||||
latestEventCache.clear();
|
||||
machine->failed = true;
|
||||
} else if (kt == InjectFaults) {
|
||||
@ -1631,8 +1631,7 @@ public:
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting ||
|
||||
machine->name == "remote flow process");
|
||||
ASSERT(!protectedAddresses.count(machine->address) || machine->rebooting || machine->isSpawnedKVProcess());
|
||||
}
|
||||
void rebootProcess(ProcessInfo* process, KillType kt) override {
|
||||
if (kt == RebootProcessAndDelete && protectedAddresses.count(process->address)) {
|
||||
@ -2498,7 +2497,7 @@ ACTOR void doReboot(ISimulator::ProcessInfo* p, ISimulator::KillType kt) {
|
||||
.detail("Rebooting", p->rebooting)
|
||||
.detail("Reliable", p->isReliable());
|
||||
return;
|
||||
} else if (p->name == "remote flow process") {
|
||||
} else if (p->isSpawnedKVProcess()) {
|
||||
TraceEvent(SevDebug, "DoRebootFailed").detail("Name", p->name).detail("Address", p->address);
|
||||
return;
|
||||
} else if (p->getChilds().size()) {
|
||||
|
@ -71,14 +71,12 @@ struct SaveAndKillWorkload : TestWorkload {
|
||||
std::map<NetworkAddress, ISimulator::ProcessInfo*> rebootingProcesses = g_simulator.currentlyRebootingProcesses;
|
||||
std::map<std::string, ISimulator::ProcessInfo*> allProcessesMap;
|
||||
for (const auto& [_, process] : rebootingProcesses) {
|
||||
if (allProcessesMap.find(process->dataFolder) == allProcessesMap.end() &&
|
||||
process->name != "remote flow process") {
|
||||
if (allProcessesMap.find(process->dataFolder) == allProcessesMap.end() && !process->isSpawnedKVProcess()) {
|
||||
allProcessesMap[process->dataFolder] = process;
|
||||
}
|
||||
}
|
||||
for (const auto& process : processes) {
|
||||
if (allProcessesMap.find(process->dataFolder) == allProcessesMap.end() &&
|
||||
process->name != "remote flow process") {
|
||||
if (allProcessesMap.find(process->dataFolder) == allProcessesMap.end() && !process->isSpawnedKVProcess()) {
|
||||
allProcessesMap[process->dataFolder] = process;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user