From ac4c98fd9572dc03e5d883710f2ee5443dd3aee7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 21 Mar 2020 11:11:17 +0000 Subject: [PATCH] Disable JIT and parallel workers for replication with postgres 12 --- cookbooks/tile/recipes/default.rb | 1 + cookbooks/tile/templates/default/replicate.erb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 9aa99b934..80807a0d3 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -482,6 +482,7 @@ template "/usr/local/bin/replicate" do owner "root" group "root" mode 0o755 + variables :postgresql_version => postgresql_version.to_f end systemd_service "expire-tiles" do diff --git a/cookbooks/tile/templates/default/replicate.erb b/cookbooks/tile/templates/default/replicate.erb index 83fec6fb7..bdd271f61 100644 --- a/cookbooks/tile/templates/default/replicate.erb +++ b/cookbooks/tile/templates/default/replicate.erb @@ -17,6 +17,11 @@ exec > /var/log/tile/replicate.log 2>&1 # Change to the replication state directory cd /var/lib/replicate +<% if @postgresql_version >= 12 -%> + +# Disable JIT and parallel workers in postgres +export PGOPTIONS="-c jit=off -c max_parallel_workers_per_gather=0" +<% end -%> # Install exit handler trap onexit EXIT -- 2.39.5