From 80ed08a2bb95251ab7b18b62a8831bd161cde08f Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Fri, 5 Jun 2020 09:24:47 +0200 Subject: [PATCH] Enforce synchronous_commit=local for post_init script (#1559) Patroni was already doing that before creating users for a long time, but the post_init was an oversight. It will help to all utilities relying on libpq and reduce the end-user confusion. --- patroni/postgresql/bootstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/patroni/postgresql/bootstrap.py b/patroni/postgresql/bootstrap.py index a1e7dd52..5af95bdb 100644 --- a/patroni/postgresql/bootstrap.py +++ b/patroni/postgresql/bootstrap.py @@ -130,6 +130,7 @@ class Bootstrap(object): r['host'] = 'localhost' # set it to localhost to write into pgpass env = self._postgresql.config.write_pgpass(r) if 'password' in r else None + env['PGOPTIONS'] = '-c synchronous_commit=local' try: ret = self._postgresql.cancellable.call(shlex.split(cmd) + [connstring], env=env)