Merge lp:~dsowen/charms/precise/postgresql/reload into lp:charms/postgresql

Proposed by David Owen on 2012-06-20
Status: Merged
Merged at revision: 24
Proposed branch: lp:~dsowen/charms/precise/postgresql/reload
Merge into: lp:charms/postgresql
Diff against target: 19 lines (+3/-4)
2 files modified
hooks/db-relation-changed (+2/-3)
revision (+1/-1)
To merge this branch: bzr merge lp:~dsowen/charms/precise/postgresql/reload
Reviewer Review Type Date Requested Status
charmers 2012-06-20 Pending
Review via email: mp+111247@code.launchpad.net

Description of the Change

Postgres is already running during the change hook (it has to be; the joined hook uses a running postgres, and I don't see that any relation hooks take the server down).

As we're only changing pg_hba.conf, only a reload, not a restart, is necessary. This keeps the server up and accepting TCP connections, guaranteeing the the other side of the relation can connect immediately without busy-waiting.

To post a comment you must log in.
Clint Byrum (clint-fewbar) wrote :

Great work thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/db-relation-changed'
2--- hooks/db-relation-changed 2012-06-14 02:42:58 +0000
3+++ hooks/db-relation-changed 2012-06-20 15:40:37 +0000
4@@ -23,6 +23,5 @@
5 }
6 host_can_access || grant_host_access
7
8-juju-log "starting postgresql"
9-service postgresql restart || service postgresql start
10-
11+juju-log "reloading postgresql"
12+service postgresql reload || exit 1
13
14=== modified file 'revision'
15--- revision 2012-05-03 18:30:16 +0000
16+++ revision 2012-06-20 15:40:37 +0000
17@@ -1,1 +1,1 @@
18-16
19+17

Subscribers

People subscribed via source and target branches