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(
190190 root ["ttl" ] = * cluster .Spec .Patroni .LeaderLeaseDurationSeconds
191191 root ["loop_wait" ] = * cluster .Spec .Patroni .SyncPeriodSeconds
192192
193+ // Set failsafe_mode if enabled
194+ if cluster .Spec .Patroni .FailsafeMode != nil && * cluster .Spec .Patroni .FailsafeMode {
195+ root ["failsafe_mode" ] = true
196+ }
197+
193198 // Copy the "postgresql" section before making any changes.
194199 postgresql := map [string ]any {
195200 // 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 {
1515 // +kubebuilder:validation:Type=object
1616 DynamicConfiguration SchemalessObject `json:"dynamicConfiguration,omitempty"`
1717
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+
1825 // TTL of the cluster leader lock. "Think of it as the
1926 // length of time before initiation of the automatic failover process."
2027 // Changing this value causes PostgreSQL to restart.
You can’t perform that action at this time.
0 commit comments