diff --git a/helpers/postgresql.py b/helpers/postgresql.py index 7a92d42c..7bb5b0ed 100644 --- a/helpers/postgresql.py +++ b/helpers/postgresql.py @@ -154,6 +154,7 @@ class Postgresql: cmd = self.config['restore'] ret = subprocess.call(shlex.split(os.path.abspath(cmd))+[self.scope, "replica", self.data_dir, connstring], env=env) + self.delete_trigger_file() return ret def is_leader(self, check_only=False): diff --git a/scripts/restore.py b/scripts/restore.py old mode 100644 new mode 100755 index 8dcb938c..3b95bc21 --- a/scripts/restore.py +++ b/scripts/restore.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # arguments are: # - cluster scope # - cluster role @@ -17,7 +18,7 @@ class Restore: self.scope = scope self.role = role self.connstring = connstring - self.datadir = datadir + self.data_dir = datadir self.env = os.environ.copy() def parse_connstring(self): @@ -50,7 +51,6 @@ class Restore: ret = subprocess.call(['pg_basebackup', '-R', '-D', self.data_dir, '--host=' + master_connection['host'], '--port=' + str(master_connection['port']), '-U', master_connection['user']], env=self.env) - self.delete_trigger_file() return ret