relation visibility rules different between service/service and service/subordinate relations

Bug #1560262 reported by Stuart Bishop
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Triaged
Medium
Unassigned
juju-core
Invalid
Undecided
Unassigned
postgresql (Juju Charms Collection)
Won't Fix
Undecided
Unassigned

Bug Description

Using relation-get, a unit can retrieve relation settings from peer units.

For example, in the PostgreSQL charm standby units cannot create users or generate passwords to pass to the 'db' client relation. Instead, they need to iterate over their peers and copy the credentials from the master's 'db' client relation.

This works very well, normally. Unfortunately, we have discovered it fails when the client service is a subordinate. While pg/1 can retrieve the db:1 relation settings of pg/0 if db:1 is a relation to a standard service, relation-get fails if db:1 is a relation to a subordinate service.

Note that relations to services and subordinate services look identical from the pov of the charm, so you can't change behaviour depending on what type of service it is being related to.

This asymmetry breaks our telegraf subordinate when it is added to a multi-unit PostgreSQL service.

The workarounds seem to be:
  - Document that relations to subordinates will not work
  - Never retrieve relation settings from peer units. Instead, pass the relevant data for all relations as a big encoded json blob on the peer relation or in leadership settings (for PostgreSQL, this needs to be the peer relation)

Tags: canonical-is
Stuart Bishop (stub)
tags: added: canonical-is
Changed in postgresql (Juju Charms Collection):
status: New → Won't Fix
status: Won't Fix → Triaged
Changed in postgresql-charm:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Stuart Bishop (stub) wrote :

I'm setting this as won't fix for juju-core, as the client is clearly defining the relation scope in its metadata.yaml

requires:
  postgresql:
    interface: pgsql
    scope: container

Changed in juju-core:
status: New → Invalid
Stuart Bishop (stub)
description: updated
Changed in postgresql (Juju Charms Collection):
status: Triaged → Won't Fix
Changed in postgresql-charm:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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