From d07572e80e7fc151ca91599110ff8d2904b946da Mon Sep 17 00:00:00 2001 From: Christopher Winslett Date: Thu, 19 Mar 2015 08:42:49 -0700 Subject: [PATCH] add a restarter to the ha loop --- helpers/ha.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/ha.py b/helpers/ha.py index 8ea95056..42e9de2d 100644 --- a/helpers/ha.py +++ b/helpers/ha.py @@ -73,6 +73,9 @@ class Ha: self.state_handler.follow_the_leader(self.fetch_current_leader()) return "no action. i am a secondary and i am following a leader" else: + if not self.state_handler.is_running(): + self.state_handler.start() + return "postgresql was stopped. starting again." return "no action. not healthy enough to do anything." except helpers.errors.CurrentLeaderError: print "failed to fetch current leader from etcd"