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.
This commit is contained in:
Alexander Kukushkin
2019-08-26 08:43:05 +02:00
committed by GitHub
parent 0d0c4c0a30
commit 3aa3bc3237

View File

@@ -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')),