diff --git a/patroni/ha.py b/patroni/ha.py index 90c7def5..182bfe81 100644 --- a/patroni/ha.py +++ b/patroni/ha.py @@ -364,7 +364,7 @@ class Ha(object): # Somebody else updated sync state, it may be due to us losing the lock. To be safe, postpone # promotion until next cycle. TODO: trigger immediate retry of run_cycle return 'Postponing promotion because synchronous replication state was updated by somebody else' - self.state_handler.set_synchronous_standby(None) + self.state_handler.set_synchronous_standby('*' if self.is_synchronous_mode_strict() else None) self.state_handler.promote() return promote_message diff --git a/patroni/postgresql.py b/patroni/postgresql.py index abe33ec8..a81b9472 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -1396,8 +1396,12 @@ class Postgresql(object): for f in self._configuration_to_save: config_file = os.path.join(self._config_dir, f) backup_file = os.path.join(self._data_dir, f + '.backup') - if not os.path.isfile(config_file) and os.path.isfile(backup_file): - shutil.copy(backup_file, config_file) + if not os.path.isfile(config_file): + if os.path.isfile(backup_file): + shutil.copy(backup_file, config_file) + # Previously we didn't backup pg_ident.conf, if file is missing just create empty + elif f == 'pg_ident.conf': + open(config_file, 'w').close() except IOError: logger.exception('unable to restore configuration files from backup') diff --git a/patroni/version.py b/patroni/version.py index e3983324..07f744ca 100644 --- a/patroni/version.py +++ b/patroni/version.py @@ -1 +1 @@ -__version__ = '1.3.2' +__version__ = '1.3.3'