recovery.conf doesn't include primary_conninfo for streaming replication

Bug #1275928 reported by Andreas Hasenack on 2014-02-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql (Juju Charms Collection)
Andreas Hasenack

Bug Description

The recovery.conf template conditionally includes primary_conninfo for streaming replication, if enabled:
standby_mode = on
recovery_target_timeline = latest
{% if streaming_replication %}
primary_conninfo = 'host={{host}} user=juju_replication password={{password}} requirepeer=postgres'
{% endif %}
{% if restore_command %}
restore_command = '{{restore_command}}'
{% endif %}

streaming_replication is a config setting, and it's true by default.

The code that writes out the template file, however, doesn't give the streaming_replication variable to the template engine:
    recovery_conf = Template(open(template_file).read()).render({
        'host': master_host,
        'password': local_state['replication_password']})

So it's not rendered, and the second postgresql unit does no replication at all and remains read-only.

Related branches

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Note that the code also doesn't include the restore_command variable, but I couldn't find where that one was defined. Maybe it's work in progress and should be removed. Or it's a config setting that wasn't added to the charm's config.yaml by mistake.

Changed in postgresql (Juju Charms Collection):
status: New → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
Stuart Bishop (stub) on 2014-02-04
Changed in postgresql (Juju Charms Collection):
status: In Progress → Fix Released
Revision history for this message
Stuart Bishop (stub) wrote :

Bug #1276024 for restore_command, which only affects an experimental feature.

tags: added: landscape
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers