Skip to content

Commit 2106494

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Remove unused installation variables
The changes to the HA system introduced in Operator 4.2 removed the need for some global configuration settings. However, this could cause some confusion as these artifacts are still present in some of the configuration files and installers. This removes those artifacts, and also introduces the `disable_auto_failover` parameter to the Ansible installation method.
1 parent 13c3fcf commit 2106494

File tree

8 files changed

+10
-37
lines changed

8 files changed

+10
-37
lines changed

ansible/inventory

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pgo_client_version='v4.2.1'
111111
#pgo_cluster_admin='false'
112112

113113
# This will set default enhancements for operator deployed PostgreSQL clusters
114-
auto_failover='false'
115114
backrest='true'
116115
badger='false'
117116
metrics='false'
@@ -131,8 +130,7 @@ log_statement='none'
131130
log_min_duration_statement=60000
132131

133132
# Autofail Settings
134-
auto_failover_replace_replica=false
135-
auto_failover_sleep_secs=9
133+
disable_auto_failover='false'
136134

137135
# Scheduler Settings
138136
scheduler_timeout=3600

ansible/roles/pgo-operator/templates/pgo.yaml.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ Cluster:
33
ReplicaNodeLabel:
44
CCPImagePrefix: {{ ccp_image_prefix }}
55
CCPImageTag: {{ ccp_image_tag }}
6-
Autofail: {{ auto_failover }}
7-
AutofailReplaceReplica: {{ auto_failover_replace_replica }}
6+
DisableAutofail: {{ disable_auto_failover }}
87
Backrest: {{ backrest }}
98
BackrestPort: {{ backrest_port }}
109
BackrestS3Bucket: {{ backrest_aws_s3_bucket }}
@@ -71,7 +70,6 @@ ContainerResources:
7170
{% endif %}
7271
{% endfor %}
7372
Pgo:
74-
AutofailSleepSeconds: {{ auto_failover_sleep_secs }}
7573
Audit: false
7674
LoadTemplate: /pgo-config/pgo.load-template.json
7775
PGOImagePrefix: {{ pgo_image_prefix }}

ansible/roles/pgo-preflight/tasks/check_inventory.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
- ccp_image_tag
1616
- pgo_image_prefix
1717
- pgo_image_tag
18-
- auto_failover
18+
- disable_auto_failover
1919
- backrest
2020
- badger
2121
- metrics
2222
- archive_mode
2323
- archive_timeout
24-
- auto_failover_sleep_secs
25-
- auto_failover_replace_replica
2624
- db_name
2725
- db_password_age_days
2826
- db_password_length

conf/postgres-operator/pgo.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Cluster:
2323
BackrestS3Endpoint:
2424
BackrestS3Region:
2525
DisableAutofail: false
26-
AutofailReplaceReplica: false
2726
LogStatement: none
2827
LogMinDurationStatement: 60000
2928
PodAntiAffinity: preferred
@@ -99,7 +98,6 @@ ContainerResources:
9998
LimitsMemory: 2Gi
10099
LimitsCPU: 4.0
101100
Pgo:
102-
AutofailSleepSeconds: 9
103101
PreferredFailoverNode:
104102
Audit: false
105103
PGOImagePrefix: crunchydata

config/pgoconfig.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ type ClusterStruct struct {
224224
BackrestS3Endpoint string `yaml:"BackrestS3Endpoint"`
225225
BackrestS3Region string `yaml:"BackrestS3Region"`
226226
DisableAutofail bool `yaml:"DisableAutofail"`
227-
AutofailReplaceReplica bool `yaml:"AutofailReplaceReplica"`
228227
PgmonitorPassword string `yaml:"PgmonitorPassword"`
229228
EnableCrunchyadm bool `yaml:"EnableCrunchyadm"`
230229
DisableReplicaStartFailReinit bool `yaml:"DisableReplicaStartFailReinit"`
@@ -250,12 +249,10 @@ type ContainerResourcesStruct struct {
250249
}
251250

252251
type PgoStruct struct {
253-
PreferredFailoverNode string `yaml:"PreferredFailoverNode"`
254-
AutofailSleepSeconds string `yaml:"AutofailSleepSeconds"`
255-
AutofailSleepSecondsValue int
256-
Audit bool `yaml:"Audit"`
257-
PGOImagePrefix string `yaml:"PGOImagePrefix"`
258-
PGOImageTag string `yaml:"PGOImageTag"`
252+
PreferredFailoverNode string `yaml:"PreferredFailoverNode"`
253+
Audit bool `yaml:"Audit"`
254+
PGOImagePrefix string `yaml:"PGOImagePrefix"`
255+
PGOImageTag string `yaml:"PGOImageTag"`
259256
}
260257

261258
type PgoConfig struct {
@@ -276,7 +273,6 @@ type PgoConfig struct {
276273
DefaultPgbouncerResources string `yaml:"DefaultPgbouncerResources"`
277274
}
278275

279-
const DEFAULT_AUTOFAIL_SLEEP_SECONDS = "30"
280276
const DEFAULT_SERVICE_TYPE = "ClusterIP"
281277
const LOAD_BALANCER_SERVICE_TYPE = "LoadBalancer"
282278
const NODEPORT_SERVICE_TYPE = "NodePort"
@@ -396,14 +392,6 @@ func (c *PgoConfig) Validate() error {
396392
if c.Pgo.PGOImageTag == "" {
397393
return errors.New(errPrefix + "Pgo.PGOImageTag is required")
398394
}
399-
if c.Pgo.AutofailSleepSeconds == "" {
400-
log.Warn("Pgo.AutofailSleepSeconds not set, using default ")
401-
c.Pgo.AutofailSleepSeconds = DEFAULT_AUTOFAIL_SLEEP_SECONDS
402-
}
403-
c.Pgo.AutofailSleepSecondsValue, err = strconv.Atoi(c.Pgo.AutofailSleepSeconds)
404-
if err != nil {
405-
return errors.New(errPrefix + "Pgo.AutofailSleepSeconds invalid int value found")
406-
}
407395

408396
if c.DefaultContainerResources != "" {
409397
_, ok = c.ContainerResources[c.DefaultContainerResources]

hugo/content/Installation/install-with-ansible/prerequisites.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ sets of variables cannot be used at the same time.
112112

113113
* `archive_mode`
114114
* `archive_timeout`
115-
* `auto_failover`
116-
* `auto_failover_sleep_secs`
117-
* `auto_failover_replace_replica`
118115
* `backup_storage`
119116
* `backrest`
120117
* `backrest_storage`
@@ -128,6 +125,7 @@ sets of variables cannot be used at the same time.
128125
* `db_port`
129126
* `db_replicas`
130127
* `db_user`
128+
* `disable_auto_failover``
131129
* `exporterport`
132130
* `kubernetes_context` (Comment out if deploying to am OpenShift environment)
133131
* `metrics`
@@ -156,9 +154,6 @@ sets of variables cannot be used at the same time.
156154
|-----------------------------------|-------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
157155
| `archive_mode` | true | **Required** | Set to true enable archive logging on all newly created clusters. |
158156
| `archive_timeout` | 60 | **Required** | Set to a value in seconds to configure the timeout threshold for archiving. |
159-
| `auto_failover` | false | **Required** | Set to true enable auto failover capabilities on all newly created cluster requests. This can be disabled by the client. |
160-
| `auto_failover_replace_replica` | false | **Required** | Set to true to replace promoted replicas during failovers with a new replica on all newly created clusters. |
161-
| `auto_failover_sleep_secs` | 9 | **Required** | Set to a value in seconds to configure the sleep time before initiating a failover on all newly created clusters. |
162157
| `backrest` | false | **Required** | Set to true enable pgBackRest capabilities on all newly created cluster request. This can be disabled by the client. |
163158
| `backrest_aws_s3_bucket` | | | Set to configure the bucket used by pgBackRest with Amazon Web Service S3 for backups and restoration in S3. |
164159
| `backrest_aws_s3_endpoint` | | | Set to configure the endpoint used by pgBackRest with Amazon Web Service S3 for backups and restoration in S3. |
@@ -182,6 +177,7 @@ sets of variables cannot be used at the same time.
182177
| `db_port` | 5432 | **Required** | Set to configure the default port used on all newly created clusters. |
183178
| `db_replicas` | 1 | **Required** | Set to configure the amount of replicas provisioned on all newly created clusters. |
184179
| `db_user` | testuser | **Required** | Set to configure the username of the dedicated user account on all newly created clusters. |
180+
| `disable_failover` | false | **Required** | Set to true disable auto failover capabilities on all newly created cluster requests. This cannot be overriden by the client on a cluster create, but on a cluster update. Setting this is not generally recommend, as it disable high-availability capabilities.|
185181
| `exporterport` | 9187 | **Required** | Set to configure the default port used to connect to postgres exporter. |
186182
| `grafana_admin_password` | | | Set to configure the login password for the Grafana administrator. |
187183
| `grafana_admin_username` | admin | | Set to configure the login username for the Grafana administrator. |

hugo/content/pgo-client/common-tasks.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ Cluster:
132132
BackrestS3Endpoint: ""
133133
BackrestS3Region: ""
134134
DisableAutofail: false
135-
AutofailReplaceReplica: false
136135
PgmonitorPassword: ""
137136
EnableCrunchyadm: false
138137
DisableReplicaStartFailReinit: false

installers/gcp-marketplace/inventory.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pgo_scheduler_image='${OPERATOR_IMAGE_SCHEDULER}'
3131
pgo_client_install='false'
3232
pgo_client_version='v4.2.1'
3333

34-
auto_failover='true'
3534
backrest='true'
3635
badger='false'
3736
metrics='${POSTGRES_METRICS}'
@@ -50,8 +49,7 @@ log_statement='none'
5049
log_min_duration_statement=60000
5150

5251
# Autofail Settings
53-
auto_failover_replace_replica=false
54-
auto_failover_sleep_secs=9
52+
disable_auto_failover='false'
5553

5654
# Scheduler Settings
5755
scheduler_timeout=3600

0 commit comments

Comments
 (0)