From 42dfaaab3f8a94642cbe6b61a0ee733f136dfe8b Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Tue, 19 May 2015 14:24:01 +0200 Subject: [PATCH] write pg_hba.conf for the replica initialized from WAL-E. Temporarily use WAL-e always as a mean to create replica for testing purposes. --- helpers/postgresql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/postgresql.py b/helpers/postgresql.py index b31d1d0f..660de55d 100644 --- a/helpers/postgresql.py +++ b/helpers/postgresql.py @@ -126,6 +126,7 @@ class Postgresql: def create_replica_with_s3(self): ret = os.system(self._wal_e + ' backup-fetch {} LATEST'.format(self.data_dir)) self.restore_postgresql_conf() + self.write_pg_hba() return ret @@ -186,7 +187,7 @@ class Postgresql: conn and conn.close() # if the size of the accumulated WAL segments is more than 5% of the backup size - we should use the pg_basebackup - return diff_in_bytes < long(backup_size) * 0.05 + return True or (diff_in_bytes < long(backup_size) * 0.05) def is_leader(self): return not self.query('SELECT pg_is_in_recovery()').fetchone()[0]