telegraf mysql (mysql-root) and postgresql (pgsql) relations are not container-scoped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Telegraf Charm |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Following investigation in bug 1717590 it was discovered that mysql and pgsql relations do not have a "container" scope (Juju-level, not reactive conversation level scope)
https:/
https:/
"requires":
"mysql":
"interface": "mysql-root"
"postgresql":
"interface": "pgsql"
Relation scope being a juju-level concept not a reactive library level concept needs to be properly set in metadata.yaml to avoid extra relation data passing:
https:/
// newSubordinateR
// about relation lifecycle events for subordinateApp, but filtered to
// be relevant to a unit deployed to a container with the
// principalName app. Global relations will be included, but only
// container-scoped relations for the principal application will be
// emitted - other container-scoped relations will be filtered out.
https:/
"Principal application: A traditional application or charm in whose container subordinate applications will execute.
Subordinate application/charm: An application designed for and deployed to the running container of another application unit.
Container relation: A scope:container relationship. While modeled identically to traditional, scope: global, relationships, juju only implements the relationship between the units belonging to the same container."
So, we need to make sure that telegraf, while being a subordinate charm (subordinate": "true" in metadata.yaml), also has a proper relation scope for mysql (and pgsql) relation so that mysql-relation-
Just in case, telegraf collects metrics from mysql so a single agent only needs to reside on the same host and talk to a particular mysql instance https:/
Related branches
- Stuart Bishop (community): Disapprove
-
Diff: 15 lines (+2/-0)1 file modifiedmetadata.yaml (+2/-0)
description: | updated |
tags: | added: cdo-qa cdo-qa-blocker foundations-engine |
tags: |
added: cpe-onsite removed: cpec |
Changed in charm-telegraf: | |
importance: | Undecided → Low |
Changed in charm-telegraf: | |
status: | Triaged → Won't Fix |
The pgsql interface is not container scoped and does not function correctly if used as a container scoped relation, which is why telegraf does not try to declare it as container scoped.
As best I can tell, what should happen when one end of a relation declares the scope as container and the other as global is undefined (although it does happen to work with many simpler relations). For PostgreSQL, the particular problem is that the relation becomes container scoped and the PostgreSQL units are unable to see their peers, breaking the implementation because the standby units never see the master unit join the relation.