From d2b681b07e4bdf5b7068667306446b306fbc8c43 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Tue, 21 Dec 2021 11:20:06 +0100 Subject: [PATCH] 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`. --- patroni/ha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroni/ha.py b/patroni/ha.py index e9a4a641..96eac372 100644 --- a/patroni/ha.py +++ b/patroni/ha.py @@ -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()