Skip to content

Commit

Permalink
Add support for replacing failed process groups in a fault domain (#1943
Browse files Browse the repository at this point in the history
)

* Add support for replacing failed process groups in a fault domain
  • Loading branch information
johscheuer authored Feb 21, 2024
1 parent 26fae3d commit 0eb4361
Show file tree
Hide file tree
Showing 8 changed files with 870 additions and 245 deletions.
14 changes: 14 additions & 0 deletions api/v1beta2/foundationdbcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,14 @@ type AutomaticReplacementOptions struct {
// The default is false.
Enabled *bool `json:"enabled,omitempty"`

// FaultDomainBasedReplacements controls whether automatic replacements are targeting all failed process groups
// in a fault domain or only specific Process Groups. If this setting is enabled, the number of different fault
// domains that can have all their failed process groups replaced at the same time will be equal to MaxConcurrentReplacements.
// e.g. MaxConcurrentReplacements = 2 would mean that at most 2 different fault domains can have
// their failed process groups replaced at the same time.
// The default is false.
FaultDomainBasedReplacements *bool `json:"faultDomainBasedReplacements,omitempty"`

// FailureDetectionTimeSeconds controls how long a process must be
// failed or missing before it is automatically replaced.
// The default is 7200 seconds, or 2 hours.
Expand Down Expand Up @@ -2155,6 +2163,12 @@ func (cluster *FoundationDBCluster) GetMaxConcurrentAutomaticReplacements() int
return pointer.IntDeref(cluster.Spec.AutomationOptions.Replacements.MaxConcurrentReplacements, 1)
}

// FaultDomainBasedReplacements returns true if the operator is allowed to replace all failed process groups of a
// fault domain. Default is false
func (cluster *FoundationDBCluster) FaultDomainBasedReplacements() bool {
return pointer.BoolDeref(cluster.Spec.AutomationOptions.Replacements.FaultDomainBasedReplacements, false)
}

// CoordinatorSelectionSetting defines the process class and the priority of it.
// A higher priority means that the process class is preferred over another.
type CoordinatorSelectionSetting struct {
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10194,6 +10194,8 @@ spec:
type: boolean
failureDetectionTimeSeconds:
type: integer
faultDomainBasedReplacements:
type: boolean
maxConcurrentReplacements:
default: 1
minimum: 0
Expand Down
Loading

0 comments on commit 0eb4361

Please sign in to comment.