diff options
author | Martin Pihlak | 2011-01-13 13:31:03 +0000 |
---|---|---|
committer | Martin Pihlak | 2011-01-13 13:31:03 +0000 |
commit | 4d0756226bb24eb2816537c344e69bae34106818 (patch) | |
tree | ee40e9922feb8d745fb455f5a409dc1a2f9e9fb7 /python/walmgr.py | |
parent | d4c094ead5e6373f06942011bb57d33716e46253 (diff) |
Fix "walmgr stop" not to disable archive_mode.
That is, unless master_restart_cmd is defined.
Diffstat (limited to 'python/walmgr.py')
-rwxr-xr-x | python/walmgr.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/python/walmgr.py b/python/walmgr.py index edbe0952..43e115f1 100755 --- a/python/walmgr.py +++ b/python/walmgr.py @@ -564,26 +564,24 @@ class WalMgr(skytools.DBScript): else: # disable archiving + cf_params = dict() - cf_params = { - "archive_mode": "off", - "wal_level": "minimal", - "archive_command": "" - } + if can_restart: + # can restart, disable archive mode and set wal_level to minimal - if curr_archive_mode is None: - self.log.info("archive_mode not set") - del(cf_params['archive_mode']) + cf_params['archive_command'] = '' - if curr_wal_level is None: - self.log.info("wal_level not set") - del(cf_params['wal_level']) - - if not can_restart: + if curr_archive_mode: + cf_params['archive_mode'] = 'off' + if curr_wal_level: + cf_params['wal_level'] = 'minimal' + cf_params['max_wal_senders'] = '0' + else: # not possible to change archive_mode or wal_level (requires restart), # so we just set the archive_command to /bin/true to avoid WAL pileup. self.log.warning("database must be restarted to disable archiving") self.log.info("Setting archive_command to /bin/true to avoid WAL pileup") + cf_params['archive_command'] = '/bin/true' self.log.debug("modifying configuration: %s" % cf_params) |