Merge branch 'master' of github.com:zalando/patroni into feature/quorum-commit

This commit is contained in:
Alexander Kukushkin
2023-07-21 13:23:27 +02:00
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -476,6 +476,12 @@ class RestApiHandler(BaseHTTPRequestHandler):
* ``patroni_dcs_last_seen``: epoch timestamp when DCS was last contacted successfully;
* ``patroni_pending_restart``: ``1`` if this PostgreSQL node is pending a restart, else ``0``;
* ``patroni_is_paused``: ``1`` if Patroni is in maintenance node, else ``0``.
For PostgreSQL v9.6+ the response will also have the following:
* ``patroni_postgres_streaming``: 1 if Postgres is streaming from another node, else ``0``;
* ``patroni_postgres_in_archive_recovery``: ``1`` if Postgres isn't streaming and
there is ``restore_command`` available, else ``0``.
"""
postgres = self.get_postgresql_status(True)
patroni = self.server.patroni
+2 -1
View File
@@ -477,7 +477,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():