File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
pkg/apis/postgres-operator.crunchydata.com/v1beta1 Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,11 @@ func DynamicConfiguration(
190
190
root ["ttl" ] = * cluster .Spec .Patroni .LeaderLeaseDurationSeconds
191
191
root ["loop_wait" ] = * cluster .Spec .Patroni .SyncPeriodSeconds
192
192
193
+ // Set failsafe_mode if enabled
194
+ if cluster .Spec .Patroni .FailsafeMode != nil && * cluster .Spec .Patroni .FailsafeMode {
195
+ root ["failsafe_mode" ] = true
196
+ }
197
+
193
198
// Copy the "postgresql" section before making any changes.
194
199
postgresql := map [string ]any {
195
200
// TODO(cbandy): explain this. requires an archive, perhaps.
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ type PatroniSpec struct {
15
15
// +kubebuilder:validation:Type=object
16
16
DynamicConfiguration SchemalessObject `json:"dynamicConfiguration,omitempty"`
17
17
18
+ // FailsafeMode enables Patroni's failsafe mode which prevents any automated failovers.
19
+ // This is useful when performing dangerous operations like major version upgrades.
20
+ // More info: https://patroni.readthedocs.io/en/latest/dcs_failsafe_mode.html
21
+ // +optional
22
+ // +kubebuilder:default=false
23
+ FailsafeMode * bool `json:"failsafeMode,omitempty"`
24
+
18
25
// TTL of the cluster leader lock. "Think of it as the
19
26
// length of time before initiation of the automatic failover process."
20
27
// Changing this value causes PostgreSQL to restart.
You can’t perform that action at this time.
0 commit comments