fdbstatus

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanSafelyBounceProcesses

func CanSafelyBounceProcesses(
	currentUptime float64,
	minimumUptime float64,
	status *fdbv1beta2.FoundationDBStatus,
) error

CanSafelyBounceProcesses returns nil when it is safe to do a bounce on the cluster or returns an error with more information why it's not safe to bounce processes in the cluster.

func CanSafelyExcludeProcesses

func CanSafelyExcludeProcesses(status *fdbv1beta2.FoundationDBStatus) error

CanSafelyExcludeProcesses currently performs the DefaultSafetyChecks. In the future this check might be extended to perform more specific checks. Deprecated: Make use of CanSafelyExcludeOrIncludeProcesses

func CanSafelyExcludeProcessesWithRecoveryState

func CanSafelyExcludeProcessesWithRecoveryState(
	cluster *fdbv1beta2.FoundationDBCluster,
	status *fdbv1beta2.FoundationDBStatus,
	minRecoverySeconds float64,
) error

CanSafelyExcludeProcessesWithRecoveryState currently performs the DefaultSafetyChecks and makes sure that the last recovery was at least `minRecoverySeconds` seconds ago. In the future this check might be extended to perform more specific checks.

func CanSafelyIncludeProcesses

func CanSafelyIncludeProcesses(
	cluster *fdbv1beta2.FoundationDBCluster,
	status *fdbv1beta2.FoundationDBStatus,
	minRecoverySeconds float64,
) error

CanSafelyIncludeProcesses currently performs the DefaultSafetyChecks and makes sure that the last recovery was at least `minRecoverySeconds` seconds ago. In the future this check might be extended to perform more specific checks.

func CanSafelyRemoveFromStatus

func CanSafelyRemoveFromStatus(
	logger logr.Logger,
	client fdbadminclient.AdminClient,
	addresses []fdbv1beta2.ProcessAddress,
	status *fdbv1beta2.FoundationDBStatus,
) ([]fdbv1beta2.ProcessAddress, error)

CanSafelyRemoveFromStatus checks whether it is safe to remove processes from the cluster, based on the provided status.

The list returned by this method will be the addresses that are *not* safe to remove.

func CanSafelyRemoveMaintenanceMode added in v2.2.0

func CanSafelyRemoveMaintenanceMode(status *fdbv1beta2.FoundationDBStatus) error

CanSafelyRemoveMaintenanceMode will return true if the maintenance mode can be disabled.

func CheckQosStatus added in v2.2.0

func CheckQosStatus(status *fdbv1beta2.FoundationDBStatus) error

CheckQosStatus will perform checks on the QoS related metrics from the machine-readable status to validate if certain changes are safe. Check https://apple.github.io/foundationdb/administration.html#machine-readable-status for some additional background information.

func ClusterIsConfigured added in v2.2.0

func ClusterIsConfigured(
	cluster *fdbv1beta2.FoundationDBCluster,
	status *fdbv1beta2.FoundationDBStatus,
) bool

ClusterIsConfigured will return true if the cluster is configured based on the machine-readable status of the status of the FoundationDBCLuster resource.

func ConfigurationChangeAllowed

func ConfigurationChangeAllowed(
	status *fdbv1beta2.FoundationDBStatus,
	useRecoveryState bool,
) error

ConfigurationChangeAllowed will return an error if the configuration change is assumed to be unsafe. If no error is returned the configuration change can be applied.

func DefaultSafetyChecks

func DefaultSafetyChecks(
	status *fdbv1beta2.FoundationDBStatus,
	maximumActiveGenerations int,
	action string,
) error

DefaultSafetyChecks performs a set of default safety checks, e.g. it checks if the cluster is available from the client perspective and it checks that there are not too many active generations.

func DoCoordinatorFaultDomainCheckOnStatus

func DoCoordinatorFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error

DoCoordinatorFaultDomainCheckOnStatus does a coordinator related fault domain check over the given status object.

func DoFaultDomainChecksOnStatus

func DoFaultDomainChecksOnStatus(
	status *fdbv1beta2.FoundationDBStatus,
	storageServerCheck bool,
	logServerCheck bool,
	coordinatorCheck bool,
) error

DoFaultDomainChecksOnStatus does the specified fault domain check(s) over the given status object. @note this is a wrapper over the above fault domain related functions.

func DoLogServerFaultDomainCheckOnStatus

func DoLogServerFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error

DoLogServerFaultDomainCheckOnStatus does a log server related fault domain check over the given status object.

func DoStorageServerFaultDomainCheckOnStatus

func DoStorageServerFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error

DoStorageServerFaultDomainCheckOnStatus does a storage server related fault domain check over the given status object.

func GetCoordinatorsFromStatus

func GetCoordinatorsFromStatus(status *fdbv1beta2.FoundationDBStatus) map[string]fdbv1beta2.None

GetCoordinatorsFromStatus gets the current coordinators from the status. The returning set will contain all processes by their process group ID.

func GetExcludedLocalitiesFromStatus added in v2.1.0

func GetExcludedLocalitiesFromStatus(
	logger logr.Logger,
	cluster *fdbv1beta2.FoundationDBCluster,
	status *fdbv1beta2.FoundationDBStatus,
	getAdminClient func(logger logr.Logger, cluster *fdbv1beta2.FoundationDBCluster) (fdbadminclient.AdminClient, error),
) (map[fdbv1beta2.ProcessGroupID]fdbv1beta2.None, error)

GetExcludedLocalitiesFromStatus returns the excluded localities based on the machine-readable status. If the provided status is empty a new status is fetched.

func GetExclusions

func GetExclusions(status *fdbv1beta2.FoundationDBStatus) ([]fdbv1beta2.ProcessAddress, error)

GetExclusions gets a list of the addresses currently excluded from the database, based on the provided status.

func GetMinimumUptimeAndAddressMap

func GetMinimumUptimeAndAddressMap(
	logger logr.Logger,
	cluster *fdbv1beta2.FoundationDBCluster,
	status *fdbv1beta2.FoundationDBStatus,
	recoveryStateEnabled bool,
) (float64, map[fdbv1beta2.ProcessGroupID][]fdbv1beta2.ProcessAddress, error)

GetMinimumUptimeAndAddressMap returns address map of the processes included the the foundationdb status. The minimum uptime will be either secondsSinceLastRecovered if the recovery state is supported and enabled otherwise we will take the minimum uptime of all processes.

func HasDesiredFaultToleranceFromStatus

func HasDesiredFaultToleranceFromStatus(
	log logr.Logger,
	status *fdbv1beta2.FoundationDBStatus,
	cluster *fdbv1beta2.FoundationDBCluster,
) bool

HasDesiredFaultToleranceFromStatus checks if the cluster has the desired fault tolerance based on the provided status.

func PrettyPrintBytes added in v2.2.0

func PrettyPrintBytes(bytes int64) string

PrettyPrintBytes will return a string that represents the storedBytes in a human-readable format.

func RemoveWarningsInJSON

func RemoveWarningsInJSON(jsonString string) ([]byte, error)

RemoveWarningsInJSON removes any warning messages that might appear in the status output from the fdbcli and returns the JSON output without the warning message.

Types

type StatusContextKey

type StatusContextKey struct{}

StatusContextKey will be used as a key in a context to pass down the cached status.

Jump to

Keyboard shortcuts

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