Merge lp:~stub/charms/trusty/postgresql/standby-service into lp:charms/trusty/postgresql

Proposed by Stuart Bishop
Status: Merged
Merged at revision: 128
Proposed branch: lp:~stub/charms/trusty/postgresql/standby-service
Merge into: lp:charms/trusty/postgresql
Diff against target: 16 lines (+6/-0)
1 file modified
hooks/hooks.py (+6/-0)
To merge this branch: bzr merge lp:~stub/charms/trusty/postgresql/standby-service
Reviewer Review Type Date Requested Status
Tim Van Steenburgh (community) Approve
Stuart Bishop (community) Abstain
Review via email: mp+264402@code.launchpad.net

Description of the change

The last landing broke PostgreSQL < 9.4 installs using the default configuration options.

Fix this by downgrading unsupported wal_level's when necessary. This seems preferable to changing the default, which would mean requiring the wal_level to be set before the new relation type would actually work.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) :
review: Abstain
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2015-07-09 18:35:13 +0000
3+++ hooks/hooks.py 2015-07-10 11:12:07 +0000
4@@ -414,6 +414,12 @@
5 host.write_file(postgresql_sysctl, ''.join(lines), perms=0600)
6 _run_sysctl(postgresql_sysctl)
7
8+ # Our config file specifies a default wal_level that only works
9+ # with PostgreSQL 9.4. Downgrade this for earlier versions of
10+ # PostgreSQL. We have this default so more things Just Work.
11+ if pg_version() < '9.4' and config_data['wal_level'] == 'logical':
12+ config_data['wal_level'] = 'hot_standby'
13+
14 # If we are replicating, some settings may need to be overridden to
15 # certain minimum levels.
16 num_slaves = slave_count()

Subscribers

People subscribed via source and target branches

to all changes: