mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-19 04:26:17 +08:00
Add comments about the use of protectedAddresses.
This commit is contained in:
parent
c5366e1116
commit
48e1b06d29
@ -451,7 +451,13 @@ public:
|
|||||||
int physicalDatacenters;
|
int physicalDatacenters;
|
||||||
int processesPerMachine;
|
int processesPerMachine;
|
||||||
int listenersPerProcess;
|
int listenersPerProcess;
|
||||||
|
|
||||||
|
// We won't kill machines in this set, but we might reboot
|
||||||
|
// them. This is a conservatie mechanism to prevent the
|
||||||
|
// simulator from killing off imporant processes and rendering
|
||||||
|
// the cluster unrecoverable, e.g. a quorum of coordinators.
|
||||||
std::set<NetworkAddress> protectedAddresses;
|
std::set<NetworkAddress> protectedAddresses;
|
||||||
|
|
||||||
std::map<NetworkAddress, ProcessInfo*> currentlyRebootingProcesses;
|
std::map<NetworkAddress, ProcessInfo*> currentlyRebootingProcesses;
|
||||||
std::vector<std::string> extraDatabases;
|
std::vector<std::string> extraDatabases;
|
||||||
Reference<IReplicationPolicy> storagePolicy;
|
Reference<IReplicationPolicy> storagePolicy;
|
||||||
|
@ -2172,6 +2172,10 @@ void setupSimulatedSystem(std::vector<Future<Void>>* systemActors,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(coordinatorAddresses.size() > 0);
|
ASSERT(coordinatorAddresses.size() > 0);
|
||||||
|
|
||||||
|
// Mark a random majority of the coordinators as protected, so
|
||||||
|
// we won't accidently kill off a quorum and render the
|
||||||
|
// cluster unrecoverable.
|
||||||
deterministicRandom()->randomShuffle(coordinatorAddresses);
|
deterministicRandom()->randomShuffle(coordinatorAddresses);
|
||||||
for (int i = 0; i < (coordinatorAddresses.size() / 2) + 1; i++) {
|
for (int i = 0; i < (coordinatorAddresses.size() / 2) + 1; i++) {
|
||||||
TraceEvent("ProtectCoordinator")
|
TraceEvent("ProtectCoordinator")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user