File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ func PostgreSQL(
3636 archive += ` if [ ! -z ${timestamp} ]; then echo ${timestamp} > /pgdata/latest_commit_timestamp.txt; fi`
3737
3838 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+ }
4047
4148 // K8SPG-518: This parameter is required to ensure that the commit timestamp is
4249 // 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) {
5151 }
5252 cluster .Spec .Patroni .DynamicConfiguration = dynamic
5353
54- PostgreSQL (cluster , parameters )
54+ PostgreSQL (cluster , parameters , true )
5555 assert .DeepEqual (t , parameters .Mandatory .AsMap (), map [string ]string {
5656 "archive_mode" : "on" ,
5757 "archive_command" : strings .Join ([]string {
You can’t perform that action at this time.
0 commit comments