mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix bug in the bootstrap standby-leader (#2144)
When starting postgres after bootstrap of the standby-leader the `follow()` method is used to always return `True`. This behavior was changed in the #2054 in order to avoid hammering logs if postgres is failing to start. Since now the method returns `None` if postgres didn't start accepting connections after 60s, the change broke the standby-leader bootstrap code. As the solution, we will assume that the clone was successful if the `follow()` method returned anything different from `False`.
This commit is contained in:
+1
-1
@@ -241,7 +241,7 @@ class Ha(object):
|
||||
logger.info('bootstrapped %s', msg)
|
||||
cluster = self.dcs.get_cluster()
|
||||
node_to_follow = self._get_node_to_follow(cluster)
|
||||
return self.state_handler.follow(node_to_follow)
|
||||
return self.state_handler.follow(node_to_follow) is not False
|
||||
else:
|
||||
logger.error('failed to bootstrap %s', msg)
|
||||
self.state_handler.remove_data_directory()
|
||||
|
||||
Reference in New Issue
Block a user