From 10bbf0c3c545421c8f247fb022bee0e56bf9813d Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 30 Jan 2019 12:38:51 +0100 Subject: [PATCH] Always use replication=1, otherwise it is considered a logical walsender (#952) Fixes: https://github.com/zalando/patroni/issues/894 Fixes: https://github.com/zalando/patroni/issues/951 --- patroni/postgresql.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/patroni/postgresql.py b/patroni/postgresql.py index bd057f91..d031d847 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -1254,9 +1254,7 @@ class Postgresql(object): @contextmanager def _get_replication_connection_cursor(self, host='localhost', port=5432, database=None, **kwargs): - database = database or self._database - replication = 'database' if self._major_version >= 90400 else 1 - with self._get_connection_cursor(host=host, port=int(port), database=database, replication=replication, + with self._get_connection_cursor(host=host, port=int(port), database=database or self._database, replication=1, user=self._replication['username'], password=self._replication['password'], connect_timeout=3, options='-c statement_timeout=2000') as cur: yield cur