adding a unit of a related service to postgresql is racy

Bug #1187508 reported by David Britton
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postgresql (Juju Charms Collection)
Fix Released
Undecided
David Britton

Bug Description

If you have a db-admin related service to postgresql and you try and add unit, you typically look for "host" to be set in the relation data before you proceed with contacting postgresql to set things up. This works fine for the first unit, but breaks down on subsequent add-unit calls.

The problem is on each add-unit call relation data is already supplied (from the previous relation attempt), but the postgresql charm actually needs to add the joining unit into the pg_hba.conf file and restart the service to allow the unit to connect. Otherwise you end up with the following in the pgsql log files:

2013-05-29 19:39:41 UTC FATAL: no pg_hba.conf entry for host "10.154.134.171", user "db_admin_4_landscape_admin", database "postgres", SSL on
2013-05-29 19:39:41 UTC DETAIL: Client IP address resolved to "ip-10-154-134-171.ec2.internal", forward lookup not checked.

There needs to be an updated list of clients that are allowed to connect to a postgresql service published in the relation data so each joining service unit knows when it's OK to contact the database.

Related branches

David Britton (dpb)
Changed in postgresql (Juju Charms Collection):
assignee: nobody → David Britton (davidpbritton)
Stuart Bishop (stub)
Changed in postgresql (Juju Charms Collection):
status: New → In Progress
Stuart Bishop (stub)
Changed in postgresql (Juju Charms Collection):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.