diff --git a/fdbserver/ClusterController.actor.cpp b/fdbserver/ClusterController.actor.cpp index 46e37a0bee..136330f5ee 100644 --- a/fdbserver/ClusterController.actor.cpp +++ b/fdbserver/ClusterController.actor.cpp @@ -3405,7 +3405,7 @@ ProcessClass::Fitness findBestFitnessForSingleton(const ClusterControllerData* s // the singleton is stable (see below) and doesn't need to be rerecruited. // Side effects: (possibly) initiates recruitment template -bool rerecruitSingleton(ClusterControllerData* self, +bool isHealthySingleton(ClusterControllerData* self, const WorkerDetails& newWorker, const Singleton& singleton, const ProcessClass::Fitness& bestFitness, @@ -3439,7 +3439,7 @@ bool rerecruitSingleton(ClusterControllerData* self, .detail("Excluded", currWorker.priorityInfo.isExcluded) .detail("Fitness", currFitness) .detail("BestFitness", bestFitness); - singleton.recruit(self); + singleton.recruit(self); // SIDE EFFECT: initiating recruitment return false; // not healthy since needed to be rerecruited } else { return true; // healthy because doesn't need to be rerecruited @@ -3492,11 +3492,12 @@ void checkBetterSingletons(ClusterControllerData* self) { auto rkSingleton = RatekeeperSingleton(db.ratekeeper); auto ddSingleton = DataDistributorSingleton(db.distributor); - // Try to rerecruit the singletons to more optimal processes - bool rkHealthy = rerecruitSingleton( + // Check if the singletons are healthy. + // side effect: try to rerecruit the singletons to more optimal processes + bool rkHealthy = isHealthySingleton( self, newRKWorker, rkSingleton, bestFitnessForRK, self->recruitingRatekeeperID); - bool ddHealthy = rerecruitSingleton( + bool ddHealthy = isHealthySingleton( self, newDDWorker, ddSingleton, bestFitnessForDD, self->recruitingDistributorID); // if any of the singletons are unhealthy (rerecruited or not stable), then do not