Merge lp:~stub/charms/precise/postgresql/data-checksums into lp:charms/postgresql

Proposed by Stuart Bishop
Status: Merged
Merge reported by: Marco Ceppi
Merged at revision: not available
Proposed branch: lp:~stub/charms/precise/postgresql/data-checksums
Merge into: lp:charms/postgresql
Prerequisite: lp:~stub/charms/precise/postgresql/test-upgrade-charm
Diff against target: 30 lines (+11/-1)
1 file modified
hooks/hooks.py (+11/-1)
To merge this branch: bzr merge lp:~stub/charms/precise/postgresql/data-checksums
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+231951@code.launchpad.net

Description of the change

Data checksums are a new feature added to PostgreSQL 9.3 that cause the database to halt when corruption is detected.

I have elected to turn the feature on by default for all new PG 9.3 installations. Since release, I'm seeing more recommendations to use the feature. It seems particularly useful with Juju environments, where we are often using remote disk.

To post a comment you must log in.
158. By Stuart Bishop

Merged test-upgrade-charm into data-checksums.

159. By Stuart Bishop

Merged test-upgrade-charm into data-checksums.

160. By Stuart Bishop

Merged test-upgrade-charm into data-checksums.

161. By Stuart Bishop

Merged test-upgrade-charm into data-checksums.

Revision history for this message
Whit Morriss (whitmo) wrote :

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 2014-08-27 12:56:22 +0000
3+++ hooks/hooks.py 2014-08-27 12:56:22 +0000
4@@ -4,6 +4,7 @@
5 from contextlib import contextmanager
6 import commands
7 import cPickle as pickle
8+from distutils.version import StrictVersion
9 import glob
10 from grp import getgrnam
11 import os.path
12@@ -341,8 +342,17 @@
13 "-e", hookenv.config('encoding')]
14 if hookenv.config('listen_port'):
15 create_cmd.extend(["-p", str(hookenv.config('listen_port'))])
16- create_cmd.append(pg_version())
17+ version = pg_version()
18+ create_cmd.append(version)
19 create_cmd.append(hookenv.config('cluster_name'))
20+
21+ # With 9.3+, we make an opinionated decision to always enable
22+ # data checksums. This seems to be best practice. We could
23+ # turn this into a configuration item if there is need. There
24+ # is no way to enable this option on existing clusters.
25+ if StrictVersion(version) >= StrictVersion('9.3'):
26+ create_cmd.extend(['--', '--data-checksums'])
27+
28 run(create_cmd)
29 # Ensure SSL certificates exist, as we enable SSL by default.
30 create_ssl_cert(os.path.join(

Subscribers

People subscribed via source and target branches