Add comments about the use of protectedAddresses.
This commit is contained in:
parent
c5366e1116
commit
48e1b06d29
|
@ -451,7 +451,13 @@ public:
|
|||
int physicalDatacenters;
|
||||
int processesPerMachine;
|
||||
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::map<NetworkAddress, ProcessInfo*> currentlyRebootingProcesses;
|
||||
std::vector<std::string> extraDatabases;
|
||||
Reference<IReplicationPolicy> storagePolicy;
|
||||
|
|
|
@ -2172,6 +2172,10 @@ void setupSimulatedSystem(std::vector<Future<Void>>* systemActors,
|
|||
}
|
||||
|
||||
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);
|
||||
for (int i = 0; i < (coordinatorAddresses.size() / 2) + 1; i++) {
|
||||
TraceEvent("ProtectCoordinator")
|
||||
|
|
Loading…
Reference in New Issue