Merge lp:~ahasenack/charms/precise/postgresql/postgresql-fix-recovery-conf into lp:charms/postgresql

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 84
Proposed branch: lp:~ahasenack/charms/precise/postgresql/postgresql-fix-recovery-conf
Merge into: lp:charms/postgresql
Diff against target: 17 lines (+3/-1)
1 file modified
hooks/hooks.py (+3/-1)
To merge this branch: bzr merge lp:~ahasenack/charms/precise/postgresql/postgresql-fix-recovery-conf
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+204576@code.launchpad.net

Commit message

Include streaming_replication when writing out the recovery.conf file so that primary_conninfo gets added to it and replication can work.

Description of the change

Include streaming_replication when writing out the recovery.conf file so that primary_conninfo gets added to it and replication can work.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

I've already got this waiting in https://code.launchpad.net/~stub/charms/precise/postgresql/pg93/+merge/202841. I'll land this patch though and resolve conflicts since this bug will block people.

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote :

This didn't get picked up earlier, as there was no actual test that data was actually flowing from master to slave. My branch adds a test for this, so no need for one here.

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-01-31 12:12:51 +0000
3+++ hooks/hooks.py 2014-02-03 21:14:51 +0000
4@@ -628,10 +628,12 @@
5 old_recovery_conf = None
6
7 charm_dir = hookenv.charm_dir()
8+ streaming_replication = hookenv.config('streaming_replication')
9 template_file = "{}/templates/recovery.conf.tmpl".format(charm_dir)
10 recovery_conf = Template(open(template_file).read()).render({
11 'host': master_host,
12- 'password': local_state['replication_password']})
13+ 'password': local_state['replication_password'],
14+ 'streaming_replication': streaming_replication})
15 log(recovery_conf, DEBUG)
16 host.write_file(
17 os.path.join(postgresql_cluster_dir, 'recovery.conf'),

Subscribers

People subscribed via source and target branches