Documentation ¶
Index ¶
- func CanSafelyBounceProcesses(currentUptime float64, minimumUptime float64, ...) error
- func CanSafelyExcludeProcesses(status *fdbv1beta2.FoundationDBStatus) error
- func CanSafelyExcludeProcessesWithRecoveryState(cluster *fdbv1beta2.FoundationDBCluster, status *fdbv1beta2.FoundationDBStatus, ...) error
- func CanSafelyIncludeProcesses(cluster *fdbv1beta2.FoundationDBCluster, status *fdbv1beta2.FoundationDBStatus, ...) error
- func CanSafelyRemoveFromStatus(logger logr.Logger, client fdbadminclient.AdminClient, ...) ([]fdbv1beta2.ProcessAddress, error)
- func ConfigurationChangeAllowed(status *fdbv1beta2.FoundationDBStatus, useRecoveryState bool) error
- func DefaultSafetyChecks(status *fdbv1beta2.FoundationDBStatus, maximumActiveGenerations int, ...) error
- func DoCoordinatorFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error
- func DoFaultDomainChecksOnStatus(status *fdbv1beta2.FoundationDBStatus, storageServerCheck bool, ...) error
- func DoLogServerFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error
- func DoStorageServerFaultDomainCheckOnStatus(status *fdbv1beta2.FoundationDBStatus) error
- func GetCoordinatorsFromStatus(status *fdbv1beta2.FoundationDBStatus) map[string]fdbv1beta2.None
- func GetExclusions(status *fdbv1beta2.FoundationDBStatus) ([]fdbv1beta2.ProcessAddress, error)
- func GetMinimumUptimeAndAddressMap(logger logr.Logger, cluster *fdbv1beta2.FoundationDBCluster, ...) (float64, map[fdbv1beta2.ProcessGroupID][]fdbv1beta2.ProcessAddress, error)
- func HasDesiredFaultToleranceFromStatus(log logr.Logger, status *fdbv1beta2.FoundationDBStatus, ...) bool
- func RemoveWarningsInJSON(jsonString string) ([]byte, error)
- type StatusContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanSafelyBounceProcesses ¶ added in v1.32.0
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 ¶ added in v1.32.0
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 ¶ added in v1.35.0
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 ¶ added in v1.35.0
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 ConfigurationChangeAllowed ¶ added in v1.34.0
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 ¶ added in v1.32.0
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 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 RemoveWarningsInJSON ¶
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.