File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ func PostgreSQL(
36
36
archive += ` if [ ! -z ${timestamp} ]; then echo ${timestamp} > /pgdata/latest_commit_timestamp.txt; fi`
37
37
38
38
outParameters .Mandatory .Add ("archive_mode" , "on" )
39
- outParameters .Mandatory .Add ("archive_command" , archive )
39
+
40
+ if backupsEnabled {
41
+ outParameters .Mandatory .Add ("archive_command" , archive )
42
+ } else {
43
+ // If backups are disabled, keep archive_mode on (to avoid a Postgres restart)
44
+ // and throw away WAL.
45
+ outParameters .Mandatory .Add ("archive_command" , `true` )
46
+ }
40
47
41
48
// K8SPG-518: This parameter is required to ensure that the commit timestamp is
42
49
// included in the WAL file. This is necessary for the WAL watcher to
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func TestPostgreSQLParameters(t *testing.T) {
51
51
}
52
52
cluster .Spec .Patroni .DynamicConfiguration = dynamic
53
53
54
- PostgreSQL (cluster , parameters )
54
+ PostgreSQL (cluster , parameters , true )
55
55
assert .DeepEqual (t , parameters .Mandatory .AsMap (), map [string ]string {
56
56
"archive_mode" : "on" ,
57
57
"archive_command" : strings .Join ([]string {
You can’t perform that action at this time.
0 commit comments