Return the real member name when picking the sync standby (#1253)

Before we returned it in the lower case, what was preventing such a standby from promoting due to the name comparison mismatch.

Fixes https://github.com/zalando/patroni/issues/1252
This commit is contained in:
Alexander Kukushkin
2019-10-25 14:53:05 +02:00
committed by GitHub
parent 6fe482a4c8
commit 2a9ef418d6
+2 -2
View File
@@ -813,9 +813,9 @@ class Postgresql(object):
return app_name, True
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
return cluster.sync.sync_standby, False
if sync_state in ('async', 'potential'):
candidates.append(app_name)
candidates.append(member.name)
if candidates:
return candidates[0], False