mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Ha loop was writing into scheduled_at during "manual_failover"
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ class RestApiHandler(BaseHTTPRequestHandler):
|
||||
elif scheduled_at < datetime.datetime.now(pytz.utc):
|
||||
data = b'Cannot schedule failover in the past'
|
||||
status_code = 422
|
||||
elif self.server.patroni.dcs.manual_failover(leader, member, scheduled_at):
|
||||
elif self.server.patroni.dcs.manual_failover(leader, member, scheduled_at=scheduled_at):
|
||||
data = b'Failover scheduled'
|
||||
status_code = 200
|
||||
except (ValueError, TypeError):
|
||||
|
||||
+2
-2
@@ -298,7 +298,7 @@ class Ha(object):
|
||||
return
|
||||
elif delta < - int(self.patroni.nap_time * 1.5):
|
||||
logger.warning('Found a stale failover value, cleaning up: %s', failover.scheduled_at)
|
||||
self.dcs.manual_failover('', '', self.cluster.failover.index)
|
||||
self.dcs.manual_failover('', '', index=self.cluster.failover.index)
|
||||
return
|
||||
|
||||
# The value is very close to now
|
||||
@@ -323,7 +323,7 @@ class Ha(object):
|
||||
self.cluster.failover.leader, self.state_handler.name)
|
||||
|
||||
logger.info('Trying to clean up failover key')
|
||||
self.dcs.manual_failover('', '', self.cluster.failover.index)
|
||||
self.dcs.manual_failover('', '', index=self.cluster.failover.index)
|
||||
|
||||
def process_unhealthy_cluster(self):
|
||||
if self.is_healthiest_node():
|
||||
|
||||
Reference in New Issue
Block a user