Skip to content

Commit 0eb4361

Browse files
authored
Add support for replacing failed process groups in a fault domain (#1943)
* Add support for replacing failed process groups in a fault domain
1 parent 26fae3d commit 0eb4361

8 files changed

+870
-245
lines changed

api/v1beta2/foundationdbcluster_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,14 @@ type AutomaticReplacementOptions struct {
12151215
// The default is false.
12161216
Enabled *bool `json:"enabled,omitempty"`
12171217

1218+
// FaultDomainBasedReplacements controls whether automatic replacements are targeting all failed process groups
1219+
// in a fault domain or only specific Process Groups. If this setting is enabled, the number of different fault
1220+
// domains that can have all their failed process groups replaced at the same time will be equal to MaxConcurrentReplacements.
1221+
// e.g. MaxConcurrentReplacements = 2 would mean that at most 2 different fault domains can have
1222+
// their failed process groups replaced at the same time.
1223+
// The default is false.
1224+
FaultDomainBasedReplacements *bool `json:"faultDomainBasedReplacements,omitempty"`
1225+
12181226
// FailureDetectionTimeSeconds controls how long a process must be
12191227
// failed or missing before it is automatically replaced.
12201228
// The default is 7200 seconds, or 2 hours.
@@ -2155,6 +2163,12 @@ func (cluster *FoundationDBCluster) GetMaxConcurrentAutomaticReplacements() int
21552163
return pointer.IntDeref(cluster.Spec.AutomationOptions.Replacements.MaxConcurrentReplacements, 1)
21562164
}
21572165

2166+
// FaultDomainBasedReplacements returns true if the operator is allowed to replace all failed process groups of a
2167+
// fault domain. Default is false
2168+
func (cluster *FoundationDBCluster) FaultDomainBasedReplacements() bool {
2169+
return pointer.BoolDeref(cluster.Spec.AutomationOptions.Replacements.FaultDomainBasedReplacements, false)
2170+
}
2171+
21582172
// CoordinatorSelectionSetting defines the process class and the priority of it.
21592173
// A higher priority means that the process class is preferred over another.
21602174
type CoordinatorSelectionSetting struct {

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10194,6 +10194,8 @@ spec:
1019410194
type: boolean
1019510195
failureDetectionTimeSeconds:
1019610196
type: integer
10197+
faultDomainBasedReplacements:
10198+
type: boolean
1019710199
maxConcurrentReplacements:
1019810200
default: 1
1019910201
minimum: 0

0 commit comments

Comments
 (0)