Don't try to run crash recovery if postgres is running (#2298)

It was a minor oversight of #2252 and didn't get to a release
This commit is contained in:
Alexander Kukushkin
2022-05-19 13:46:49 +02:00
committed by GitHub
parent 96b75fa7cb
commit 6e8b2ce0a4
+2 -1
View File
@@ -307,7 +307,8 @@ class Ha(object):
if self._rewind.can_rewind:
# rewind is required, but postgres wasn't shut down cleanly.
if self.state_handler.controldata().get('Database cluster state') == 'in archive recovery':
if not self.state_handler.is_running() and \
self.state_handler.controldata().get('Database cluster state') == 'in archive recovery':
msg = self._handle_crash_recovery()
if msg:
return msg