mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Avoid setting the role to unknown during rewind.
Previously, that was necessary in order to avoid repeating the rewind after failure. Nowadays, depending on the failure, we either want to retry (if PostgreSQL was not stopped on time or leader did not manage to acquire a master role yet), or won't retry at all if the leader is not available, assuming the replica role. In both cases, the hack with setting the role to unknown seems to be unnecessary and actually stops callbacks from running if rewind is done not from the first attempt.
This commit is contained in:
@@ -782,7 +782,6 @@ class Postgresql(object):
|
||||
if self._need_rewind:
|
||||
logger.info("rewind flag is set")
|
||||
|
||||
self.set_role('unknown')
|
||||
if self.is_running() and not self.stop():
|
||||
return logger.warning('Can not run pg_rewind because postgres is still running')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user