locality

package
v1.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCoordinatorValidity

func CheckCoordinatorValidity(logger logr.Logger, cluster *fdbv1beta2.FoundationDBCluster, status *fdbv1beta2.FoundationDBStatus, coordinatorStatus map[string]bool) (bool, bool, error)

CheckCoordinatorValidity determines if the cluster's current coordinators meet the fault tolerance requirements.

The first return value will be whether the coordinators are valid. The second return value will be whether the processes have their TLS flags matching the cluster spec. The third return value will hold any errors encountered when checking the coordinators.

func GetHardLimits

func GetHardLimits(cluster *fdbv1beta2.FoundationDBCluster) map[string]int

GetHardLimits returns the distribution of localities.

Types

type Info

type Info struct {
	// The process group ID
	ID string

	// The process's public address.
	Address fdbv1beta2.ProcessAddress

	// The locality map.
	LocalityData map[string]string

	// Class defines the process class of this locality.
	Class fdbv1beta2.ProcessClass

	// Priority defines the priority of this process. The priority will be used in sortLocalities and is defined based
	// on the CoordinatorSelection setting in the FoundationDBCluster resource.
	Priority int
}

Info captures information about a process for the purposes of choosing diverse locality.

func ChooseDistributedProcesses

func ChooseDistributedProcesses(cluster *fdbv1beta2.FoundationDBCluster, processes []Info, count int, constraint ProcessSelectionConstraint) ([]Info, error)

ChooseDistributedProcesses recruits a maximally well-distributed set of processes from a set of potential candidates.

func InfoForProcess

func InfoForProcess(process fdbv1beta2.FoundationDBStatusProcessInfo, mainContainerTLS bool) (Info, error)

InfoForProcess converts the process information from the JSON status into locality info for selecting processes.

func InfoFromSidecar

func InfoFromSidecar(cluster *fdbv1beta2.FoundationDBCluster, client podclient.FdbPodClient) (Info, error)

InfoFromSidecar converts the process information from the sidecar's context into locality info for selecting processes.

type ProcessSelectionConstraint

type ProcessSelectionConstraint struct {
	// Fields defines the locality fields we should consider when selecting
	// processes.
	Fields []string

	// HardLimits defines a maximum number of processes to recruit on any single
	// value for a given locality field.
	HardLimits map[string]int

	// SelectingCoordinators must be true when the ChooseDistributedProcesses is used to select coordinators.
	SelectingCoordinators bool
}

ProcessSelectionConstraint defines constraints on how we choose processes in chooseDistributedProcesses

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL