From 3aa3bc3237351f082ce01934148359c43fdec73a Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Mon, 26 Aug 2019 08:43:05 +0200 Subject: [PATCH] Pass statement_timeout=0 in PGOPTIONS when doing pg_rewind (#1155) It might happen that statement_timeout on the server is set to some small value and one of the statements executed by pg_rewind is canceled. I already proposed a patch fixing the pg_rewind itself, but it also would be good to have a workaround in Patroni. --- patroni/postgresql/rewind.py | 1 + 1 file changed, 1 insertion(+) diff --git a/patroni/postgresql/rewind.py b/patroni/postgresql/rewind.py index 23783be2..eab88b41 100644 --- a/patroni/postgresql/rewind.py +++ b/patroni/postgresql/rewind.py @@ -146,6 +146,7 @@ class Rewind(object): def pg_rewind(self, r): # prepare pg_rewind connection env = self._postgresql.write_pgpass(r) + env['PGOPTIONS'] = '-c statement_timeout=0' dsn_attrs = [ ('user', r.get('user')), ('host', r.get('host')),