Small bugfixes (#499)

* 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
This commit is contained in:
Alexander Kukushkin
2017-08-04 10:56:33 +02:00
committed by GitHub
parent d374882356
commit 4faec82380
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -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
+6 -2
View File
@@ -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')
+1 -1
View File
@@ -1 +1 @@
__version__ = '1.3.2'
__version__ = '1.3.3'