mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Start primary back when it crashed with "in crash recovery" state (#2763)
If one of backends crashed postmaster stops all backend and does crash recovery because shared memory could be corrupted. If something happens during this phase postgres may completely crash leaving pg_control with "in crash recovery" state. Followup on #2726
This commit is contained in:
+2
-1
@@ -473,7 +473,8 @@ class Ha(object):
|
||||
|
||||
# timeout > 0 indicates that we still have the leader lock, and it was just updated
|
||||
if timeout\
|
||||
and data.get('Database cluster state') in ('in production', 'shutting down', 'shut down')\
|
||||
and data.get('Database cluster state') in ('in production', 'in crash recovery',
|
||||
'shutting down', 'shut down')\
|
||||
and self.state_handler.state == 'crashed'\
|
||||
and self.state_handler.role in ('primary', 'master')\
|
||||
and not self.state_handler.config.recovery_conf_exists():
|
||||
|
||||
Reference in New Issue
Block a user