mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Set role to demoted if postgres isn't running and no recovery.conf (#757)
In really rare cases it was causing following behavior: ``` 2018-07-31 10:35:30,302 INFO: starting as a secondary 2018-07-31 10:35:30,309 INFO: Lock owner: postgresql0; I am postgresql1 2018-07-31 10:35:30,310 INFO: Demoting master during restarting after failure 2018-07-31 10:35:30,381 INFO: postmaster pid=17709 2018-07-31 10:35:30,386 INFO: lost leader lock during restarting after failure 2018-07-31 10:35:30,388 ERROR: Exception during CHECKPOINT ```
This commit is contained in:
@@ -179,6 +179,8 @@ class Postgresql(object):
|
||||
self._write_postgresql_conf() # we are "joining" already running postgres
|
||||
if self._replace_pg_hba():
|
||||
self.reload()
|
||||
elif self.role == 'master':
|
||||
self.set_role('demoted')
|
||||
|
||||
@property
|
||||
def _create_replica_methods(self):
|
||||
|
||||
Reference in New Issue
Block a user