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:
Oleksii Kliukin
2016-09-02 09:00:03 +02:00
parent f082ecf60b
commit fef4e046e1
-1
View File
@@ -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')