Skip to content

Commit

Permalink
Small bugfixes (#499)
Browse files Browse the repository at this point in the history
* Short after promote synchronous replication was disabled even is synchronous_mode_strict is set
* Create empty pg_ident.conf if it is missing after restoring from backup
* Bump version
  • Loading branch information
CyberDem0n committed Aug 4, 2017
1 parent d374882 commit 4faec82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion patroni/ha.py
Expand Up @@ -364,7 +364,7 @@ def enforce_master_role(self, message, promote_message):
# 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

Expand Down
8 changes: 6 additions & 2 deletions patroni/postgresql.py
Expand Up @@ -1396,8 +1396,12 @@ def restore_configuration_files(self):
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')

Expand Down
2 changes: 1 addition & 1 deletion patroni/version.py
@@ -1 +1 @@
__version__ = '1.3.2'
__version__ = '1.3.3'

0 comments on commit 4faec82

Please sign in to comment.