fdbserver/ClusterController.actor.cpp
// Returns true when the cluster controller should trigger a failover due to degraded servers used in the
// transaction system in the primary data center, and no degradation in the remote data center.
Returns true when the cluster controller should trigger a failover due to degraded servers used in the
transaction system in the primary data center, and no degradation in the remote data center.
Returns true when the cluster controller should trigger a failover due to degraded servers used in the transaction system in the primary data center and no degradation in the remote data center .
bool shouldTriggerFailoverDueToDegradedServers() {
		if (db.config.usableRegions <= 1) {
			return false;
		}
		if (SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION >
		    SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION) {
			TraceEvent(SevWarn, "TriggerFailoverDueToDegradedServersInvalidConfig")
			    .suppressFor(1.0)
			    .detail("Min", SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION)
			    .detail("Max", SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION);
			return false;
		}
		if (degradedServers.size() < SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION ||
		    degradedServers.size() > SERVER_KNOBS->CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION) {
			return false;
		}
		if (id_worker[clusterControllerProcessId].priorityInfo.isExcluded) {
			return false;
		}
		return transactionSystemContainsDegradedServers() && !remoteTransactionSystemContainsDegradedServers();
	}
bool shouldTriggerFailoverDueToDegradedServers ( ) { if ( db . config . usableRegions <= 1 ) { return false ; } if ( SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION > SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION ) { TraceEvent ( SevWarn , " " ) . suppressFor ( 1.0 ) . detail ( " " , SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION ) . detail ( " " , SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION ) ; return false ; } if ( degradedServers . size ( ) < SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MIN_DEGRADATION || degradedServers . size ( ) > SERVER_KNOBS -> CC_FAILOVER_DUE_TO_HEALTH_MAX_DEGRADATION ) { return false ; } if ( id_worker [ clusterControllerProcessId ] . priorityInfo . isExcluded ) { return false ; } return transactionSystemContainsDegradedServers ( ) && ! remoteTransactionSystemContainsDegradedServers ( ) ; }
Returns true when the cluster controller should trigger a failover due to degraded servers used in the
transaction system in the primary data center, and no degradation in the remote data center.
Returns true when the cluster controller should trigger a failover due to degraded servers used in the transaction system in the primary data center and no degradation in the remote data center .
// Do not trigger recovery if the cluster controller is excluded, since the master will change // anyways once the cluster controller is moved