From 518df2bc4939a8b69e3522b2377a83e694976d45 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 29 Aug 2018 11:28:46 +0200 Subject: [PATCH] Search new sync candidate amoung potential and async standbys (#794) In synchronos_mode_strict we put '*' into synchronos_standby_names, what makes one connection 'sync' and other connections 'potential'. The code picking up the correct sync standby didn't consider 'potential' as a good candidate. Fixes: https://github.com/zalando/patroni/issues/789 --- patroni/postgresql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroni/postgresql.py b/patroni/postgresql.py index a963330f..8498d76e 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -1733,7 +1733,7 @@ $$""".format(name, ' '.join(options)), name, password, password) if sync_state == 'potential' and app_name == current: # Prefer current even if not the best one any more to avoid indecisivness and spurious swaps. return current, False - if sync_state == 'async': + if sync_state in ('async', 'potential'): candidates.append(app_name) if candidates: