fdbserver/ClusterController.actor.cpp
// Finds and returns a new process for role
Finds and returns a new process for role
Finds and returns a new process for role
WorkerDetails findNewProcessForSingleton(ClusterControllerData* self,
                                         const ProcessClass::ClusterRole role,
                                         std::map<Optional<Standalone<StringRef>>, int>& id_used) {
	WorkerDetails newWorker =
	    self->getWorkerForRoleInDatacenter(
	            self->clusterControllerDcId, role, ProcessClass::NeverAssign, self->db.config, id_used, {}, true)
	        .worker;
	if (self->onMasterIsBetter(newWorker, role)) {
		newWorker = self->id_worker[self->masterProcessId.get()].details;
	}
	id_used[newWorker.interf.locality.processId()]++;
	return newWorker;
}
WorkerDetails findNewProcessForSingleton ( ClusterControllerData * self , const ProcessClass :: ClusterRole role , std :: map < Optional < Standalone < StringRef > > , int > & id_used ) { WorkerDetails newWorker = self -> getWorkerForRoleInDatacenter ( self -> clusterControllerDcId , role , ProcessClass :: NeverAssign , self -> db . config , id_used , { } , true ) . worker ; if ( self -> onMasterIsBetter ( newWorker , role ) ) { newWorker = self -> id_worker [ self -> masterProcessId . get ( ) ] . details ; } id_used [ newWorker . interf . locality . processId ( ) ] ++ ; return newWorker ; }
Finds and returns a new process for role
Finds and returns a new process for role
// find new process in cluster for role // check if master's process is actually better suited for role // acknowledge that the pid is now potentially used by this role as well