From d891b9590a8d9d3c3f53a9a81c384a69159d50b5 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 2 May 2022 12:02:46 -0700 Subject: [PATCH] puppet: Fix non-replicated PostgreSQL 10 and 11 configuration. 6f5ae8d13dc6 removed the `$replication` variable from the configurations of PostgreSQL 12 and higher, but left it in the templates for PostgreSQL 10 and 11. Because `undef != ''`, deployments on PostgreSQL 10 and 11 started trying to push to S3 backups, regardless of if they were configured, leaving frequent log messages like: ``` 2022-04-30 12:45:47.805 UTC [626d24ec.1f8db0]: [107-1] LOG: archiver process (PID 2086106) exited with exit code 1 2022-04-30 12:45:49.680 UTC [626d24ee.1f8dc3]: [18-1] LOG: checkpoint complete: wrote 19 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=1.910 s, sync=0.022 s, total=1.950 s; sync files=16, longest=0.018 s, average=0.002 s; distance=49 kB, estimate=373 kB /usr/bin/timeout: failed to run command "/usr/local/bin/env-wal-g": No such file or directory 2022-04-30 12:46:17.852 UTC [626d2f99.1fd4e9]: [1-1] FATAL: archive command failed with exit code 127 2022-04-30 12:46:17.852 UTC [626d2f99.1fd4e9]: [2-1] DETAIL: The failed archive command was: /usr/bin/timeout 10m /usr/local/bin/env-wal-g wal-push pg_wal/000000010000000300000080 ``` Switch the PostgreSQL 10 and 11 configuration to check `s3_backups_bucket`, like the other versions. --- .../templates/postgresql/10/postgresql.conf.centos.template.erb | 2 +- .../zulip/templates/postgresql/10/postgresql.conf.template.erb | 2 +- .../zulip/templates/postgresql/11/postgresql.conf.template.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb b/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb index 987883b0d2..ed7a6bc298 100644 --- a/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb +++ b/puppet/zulip/templates/postgresql/10/postgresql.conf.centos.template.erb @@ -693,7 +693,7 @@ effective_io_concurrency = <%= @effective_io_concurrency %> listen_addresses = <%= @listen_addresses %> <% end -%> -<% if @replication != '' -%> +<% if @s3_backups_bucket != '' -%> # Primary replication settings (ignored on replica) wal_level = hot_standby max_wal_senders = 5 diff --git a/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb index b00d45f27d..a47e3cbe33 100644 --- a/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb +++ b/puppet/zulip/templates/postgresql/10/postgresql.conf.template.erb @@ -693,7 +693,7 @@ effective_io_concurrency = <%= @effective_io_concurrency %> listen_addresses = <%= @listen_addresses %> <% end -%> -<% if @replication != '' -%> +<% if @s3_backups_bucket != '' -%> # Primary replication settings (ignored on replica) wal_level = hot_standby max_wal_senders = 5 diff --git a/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb b/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb index b00d45f27d..a47e3cbe33 100644 --- a/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb +++ b/puppet/zulip/templates/postgresql/11/postgresql.conf.template.erb @@ -693,7 +693,7 @@ effective_io_concurrency = <%= @effective_io_concurrency %> listen_addresses = <%= @listen_addresses %> <% end -%> -<% if @replication != '' -%> +<% if @s3_backups_bucket != '' -%> # Primary replication settings (ignored on replica) wal_level = hot_standby max_wal_senders = 5